학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] memberController의 create 부분의 로직을 저는 아래처럼 이해했는데 맞게 이해한게 맞을까요 ? @Valid 어노테이션이 있어서 MemberForm의 @NotEmpty 조건을 validation하고 이 단계에서 NotEmpty 조건을 충족시키지 못했을 때 에러가 나는데 그 에러에 대한 내용을 bindingResult로 인해서 에러 정보를 result란 값에 저장한 뒤 result에 에러 정보가 있을 시에 members/createMemberForm으로 페이지 이동 후 createMemberForm html 파일에서 result에 name 에 대한 에러 값이 있을 때 에러메시지를 바인딩하는데 그게 NotEmpty 어노테이션 적용 시 적어뒀던 메시지를 띄우는 걸까요 .. ? 전체적인 로직을 제가 맞게 이해한건지 잘 모르겠어서요 ..
안녕하세요. JPA를 수강하고 '도메인 주도 개발 시작하기'라는 책을 읽었는데요. 궁금한 점이 생겨 글을 남기게 되었습니다. JPA의 엔티티와 값 타입에 대해 읽게 되었는데요.애그리거트[루트 앤테티]를 뺀 나머지는 구성 요서는 대부분 밸류이다. 라고 하여 라이프 사이클이 다르면 루트 엔티티로 해야 되고, 같으면 @Embeddable 애너 테이션을 사용하여 값 타입으로 구현해야 된다고 보았습니다. 강의에서는 주소를 구현할 때 잠시 사용하였던 걸로 기억하는데, 어떤 게 맞는지 궁금하여 글을 남기게 되었습니다.
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. EntityManager의 em.find() 메서드로 조회해온 엔티티는 영속 상태의 엔티티이고, 이것이 아닌 em.createQuery()로 조회해 오는 경우는 준영속 상태인가요? 보니까 JPQL로 조회해온 엔티티의 경우에는 더티 체킹이 일어나지 않는 것 같습니다. 혹시 제가 제대로 이해한 것이 맞을까요?
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 선생님처럼 이렇게 색상하려면 어떻게 해야하나요? 폰트는 intellij darcula 사용중입니다 쿼리쪽 색상 따라하고 싶어요
[질문 내용] 여기에 질문 내용을 남겨주세요. 이번에 인텔리제이를 처음 사용합니다. 모듈안에서 찾을 수 없다고 해서 pom.xml에서 의존성을 선언하였습니다. 의존성을 선언해도 오류가 발생됩니다...(구글링을 통해 버전 확인을 해봤지만 찾지 못함) <질문 요약> 1) Slf4j 버전 확인하는 법 2) pom.xml 에서 dependcy가 밑줄 이유, 해결방법 3) 의존성 선언을 하였지만 선언 실패 감사합니다.
========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) MemberRepositorytest이고 application.yml 입니다. 아래와같이 오류가 계속 뜹니다.. 아무리 해도 해결이 안 됩니다 ㅜㅜㅜ 도와주실수있으신가요 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext( DefaultCacheAwareContextLoaderDelegate.java:98 ) at org.springframework.test.context.support .DefaultTestContext.getApplicationContext( DefaultTestContext.java:124 ) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary( ServletTestExecutionListener.java:190 ) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance( ServletTestExecutionListener.java:132 ) at org.springframework.test.context.TestContextManager.prepareTestInstance( TestContextManager.java:248 ) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest( SpringJUnit4ClassRunner.java:227 ) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall( SpringJUnit4ClassRunner.java:289 ) at org.junit.internal.runners.model.ReflectiveCallable.run ( ReflectiveCallable.java:12 ) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock( SpringJUnit4ClassRunner.java:291 ) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild( SpringJUnit4ClassRunner.java:246 ) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild( SpringJUnit4ClassRunner.java:97 ) at org.junit.runners.ParentRunner$4.run( ParentRunner.java:331 ) at org.junit.runners.ParentRunner$1.schedule( ParentRunner.java:79 ) at org.junit.runners.ParentRunner.runChildren( ParentRunner.java:329 ) at org.junit.runners.ParentRunner.access$100( ParentRunner.java:66 ) at org.junit.runners.ParentRunner$2.evaluate( ParentRunner.java:293 ) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate( RunBeforeTestClassCallbacks.java:61 ) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate( RunAfterTestClassCallbacks.java:70 ) at org.junit.runners.ParentRunner$3.evaluate( ParentRunner.java:306 ) at org.junit.runners.ParentRunner.run ( ParentRunner.java:413 ) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run ( SpringJUnit4ClassRunner.java:190 ) at org.junit.runner.JUnitCore.run ( JUnitCore.java:137 ) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs( JUnit4IdeaTestRunner.java:69 ) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute( IdeaTestRunner.java:38 ) at com.intellij.rt.execution.junit.TestsRepeater.repeat( TestsRepeater.java:11 ) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs( IdeaTestRunner.java:35 ) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart( JUnitStarter.java:232 ) at com.intellij.rt.junit.JUnitStarter.main( JUnitStarter.java:55 ) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbConnection' defined in jpabook.jpashop.dbConnection defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: interface org.apache.catalina.User at org.springframework.beans.factory.support .AbstractAutowireCapableBeanFactory.initializeBean( AbstractAutowireCapableBeanFactory.java:1804 ) at org.springframework.beans.factory.support .AbstractAutowireCapableBeanFactory.doCreateBean( AbstractAutowireCapableBeanFactory.java:620 ) at org.springframework.beans.factory.support .AbstractAutowireCapableBeanFactory.createBean( AbstractAutowireCapableBeanFactory.java:542 ) at org.springframework.beans.factory.support .AbstractBeanFactory.lambda$doGetBean$0( AbstractBeanFactory.java:335 ) at org.springframework.beans.factory.support .DefaultSingletonBeanRegistry.getSingleton( DefaultSingletonBeanRegistry.java:234 ) at org.springframework.beans.factory.support .AbstractBeanFactory.doGetBean( AbstractBeanFactory.java:333 ) at org.springframework.beans.factory.support .AbstractBeanFactory.getBean( AbstractBeanFactory.java:208 ) at org.springframework.beans.factory.support .DefaultListableBeanFactory.preInstantiateSingletons( DefaultListableBeanFactory.java:936 ) at org.springframework.context.support .AbstractApplicationContext.finishBeanFactoryInitialization( AbstractApplicationContext.java:921 ) at org.springframework.context.support .AbstractApplicationContext.refresh( AbstractApplicationContext.java:583 ) at org.springframework.boot.SpringApplication.refresh( SpringApplication.java:731 ) at org.springframework.boot.SpringApplication.refreshContext( SpringApplication.java:408 ) at org.springframework.boot.SpringApplication.run ( SpringApplication.java:307 ) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext( SpringBootContextLoader.java:136 ) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal( DefaultCacheAwareContextLoaderDelegate.java:141 ) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext( DefaultCacheAwareContextLoaderDelegate.java:90 ) ... 27 more Caused by: java.lang.IllegalArgumentException: Not a managed type: interface org.apache.catalina.User at org.hibernate.metamodel.internal.MetamodelImpl.managedType( MetamodelImpl.java:583 ) at org.hibernate.metamodel.internal.MetamodelImpl.managedType( MetamodelImpl.java:85 ) at org.springframework.data.jpa.repository.support .JpaMetamodelEntityInformation.<init>( JpaMetamodelEntityInformation.java:75 ) at org.springframework.data.jpa.repository.support .JpaEntityInformationSupport.getEntityInformation( JpaEntityInformationSupport.java:66 ) at org.springframework.data.jpa.repository.support .JpaRepositoryFactory.getEntityInformation( JpaRepositoryFactory.java:233 ) at org.springframework.data.jpa.repository.support .JpaRepositoryFactory.getTargetRepository( JpaRepositoryFactory.java:182 ) at org.springframework.data.jpa.repository.support .JpaRepositoryFactory.getTargetRepository( JpaRepositoryFactory.java:165 ) at org.springframework.data.jpa.repository.support .JpaRepositoryFactory.getTargetRepository( JpaRepositoryFactory.java:76 ) at org.springframework.data.repository.core.support .RepositoryFactorySupport.getRepository( RepositoryFactorySupport.java:325 ) at org.springframework.data.repository.core.support .RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5( RepositoryFactoryBeanSupport.java:323 ) at org.springframework.data .util.Lazy.getNullable( Lazy.java:231 ) at org.springframework.data .util.Lazy.get( Lazy.java:115 ) at org.springframework.data.repository.core.support .RepositoryFactoryBeanSupport.afterPropertiesSet( RepositoryFactoryBeanSupport.java:329 ) at org.springframework.data.jpa.repository.support .JpaRepositoryFactoryBean.afterPropertiesSet( JpaRepositoryFactoryBean.java:144 ) at org.springframework.beans.factory.support .AbstractAutowireCapableBeanFactory.invokeInitMethods( AbstractAutowireCapableBeanFactory.java:1863 ) at org.springframework.beans.factory.support .AbstractAutowireCapableBeanFactory.initializeBean( AbstractAutowireCapableBeanFactory.java:1800 ) ... 42 more
public void addOrderItem(OrderItem orderItem) { orderItems.add(orderItem); orderItem.setOrder(this); } 강사님은 양방향 연결을 해서 연관관계 매서드 작성하셨는데 단방향 연결해서 orderItem에만 @ManyToOne 한 경우에는 어떻게 하나요? 아니면 다대다라서 중간테이블쓴경우에는 무조건 양방향 설정을 해야하나요?
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 에러메시지가 다음과 같습니다. 2023-08-23 16:17:14.544 ERROR 6412 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: component: jpabook.jpashop.domain.Delivery property not found: id delivery랑 member쪽에 문제가 있는 것 같은데 원인을 모르겠네요...
C:\Users\HB\Desktop\fullstack-app\frontend>npm run dev npm ERR! Missing script: "dev" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run npm ERR! A complete log of this run can be found in: C:\Users\HB\AppData\Local\npm-cache\_logs\2023-08-22T08_50_35_351Z-debug-0.log C:\Users\HB\Desktop\fullstack-app\frontend> 인터넷보고 package.json에 dev설정을 해줘야한다고해서 들어가봤는데 이미 되있더라구요 그리고 package.json이 총 2개인게 맞나요?
npm run dev 를 실행했더니 [0] Error: listen EADDRINUSE: address already in use :::5000 [0] at Server.setupListenHandle [as _listen2] (node:net:1751:16) [0] at listenInCluster (node:net:1799:12) [0] at Server.listen (node:net:1887:7) [0] at Function.listen (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\node_modules\express\lib\application.js:635:24) [0] at Object.<anonymous> (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\server\index.js:58:5) [0] at Module._compile (node:internal/modules/cjs/loader:1256:14) [0] at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) [0] at Module.load (node:internal/modules/cjs/loader:1119:32) [0] at Module._load (node:internal/modules/cjs/loader:960:12) [0] at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) [0] at node:internal/main/run_main_module:23:47 [0] Emitted 'error' event on Server instance at: [0] at emitErrorNT (node:net:1778:8) [0] at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { [0] code: 'EADDRINUSE', [0] errno: -4091, [0] syscall: 'listen', [0] address: '::', [0] port: 5000 [0] } [0] [0] Node.js v18.17.1 [0] [nodemon] app crashed - waiting for file changes before starting... [1] [HPM] Proxy created: / -> http://localhost:5000 [1] i 「wds」: Project is running at http://192.168.123.105/ [1] i 「wds」: webpack output is served from [1] i 「wds」: Content not from webpack is served from C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\public [1] i 「wds」: 404s will fallback to / [1] Starting the development server... [1] [1] Error: error:0308010C:digital envelope routines::unsupported [1] at new Hash (node:internal/crypto/hash:69:19) [1] at Object.createHash (node:crypto:133:10) [1] at module.exports (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\util\createHash.js:135:53) [1] at NormalModule._initBuildHash (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:417:16) [1] at handleParseError (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:471:10) [1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:503:5 [1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:358:12 [1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:373:3 [1] at iterateNormalLoaders (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:214:10) [1] at iterateNormalLoaders (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:221:10) [1] C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\react-scripts\scripts\start.js:19 [1] throw err; [1] ^ [1] [1] Error: error:0308010C:digital envelope routines::unsupported [1] at new Hash (node:internal/crypto/hash:69:19) [1] at Object.createHash (node:crypto:133:10) [1] at module.exports (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\util\createHash.js:135:53) [1] at NormalModule._initBuildHash (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:417:16) [1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:452:10 [1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:323:13 [1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:367:11 [1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:233:18 [1] at context.callback (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:111:13) [1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\babel-loader\lib\index.js:59:103 { [1] opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], [1] library: 'digital envelope routines', [1] reason: 'unsupported', [1] code: 'ERR_OSSL_EVP_UNSUPPORTED' [1] } [1] [1] Node.js v18.17.1 [1] npm run start --prefix client exited with code 1 이런 오류가 뜹니다. node version 이 맞지 않아 생기는 오류 같은데 확인 부탁드려요ㅠㅠ
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 네 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 네 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 네 [질문 내용] 현재 비즈니스상 Delivery 를 사용하는 곳이 Order 한 곳이라 cascade 를 사용하였는데, 추후에 기능확장으로 인해 다른 곳엔티티에서도 Delivery 를 관리하게 되는 경우 기존의 cascade 를 제거하고 orderService 의 order 비즈니스 로직을 변경해야하는 것일까요?
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 강사님 말씀대로 @Rollback(false)을 했음에도 불구하고 H2 데이터베이스에 member테이블은 생겼지만 데이터(행)는 생기지 않았습니다... 애초에 콘솔창에 Rollback 되었다는 구문도 뜨지 않고요... 어떻게 해야 할까요? <실행후 콘솔창> <실행 후 H2>
웹 계층 개발챕터 강의를 진행하고 있는 수강생입니다. 문득 궁금한점이 생겨 질문 남기게되었습니다. 코드를 작성하고 서버를 재실행하면 기존에 db에 넣어둔 데이터가 다 날아가고 없어지는게 서비스로직에 달려있는 @Transactional 어노테이션 때문인가요? 테스트코드에서의 @Trasactional 어노테이션의 경우 테스트데이터의 경우 테스트만 진행하고 테스트된 데이터는 db에 반영을 하지 않기위해서(Rollback) 사용한다고 알고있습니다. 그래서 원래 코드에서도 반영이 되지않는 이유가 서비스로직에 포함된 트랜잭션 어노테이션 때문인지 궁금하여 질문드립니다.
npm WARN old lockfile npm WARN old lockfile The package-lock.json file was created with an old version of npm, npm WARN old lockfile so supplemental metadata must be fetched from the registry. npm WARN old lockfile npm WARN old lockfile This is a one-time fix-up, please be patient... npm WARN old lockfile npm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated mkdirp@0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecated npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. ( https://github.com/visionmedia/debug/issues/797 ) npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. ( https://github.com/visionmedia/debug/issues/797 ) npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. ( https://github.com/visionmedia/debug/issues/797 ) npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future npm ERR! code 1 npm ERR! path C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@0.14.0 npm ERR! node-pre-gyp info using node@18.17.1 | win32 | x64 npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download npm ERR! node-pre-gyp info check checked for "C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node" (not found) npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v108-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v108-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v108-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@18.17.1 (node-v108 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v108-win32-x64-unknown.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.3.1 npm ERR! gyp info using node@18.17.1 | win32 | x64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.3.1 npm ERR! gyp info using node@18.17.1 | win32 | x64 npm ERR! gyp ERR! find Python npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON npm ERR! gyp ERR! find Python checking if "python3" can be used npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if "python" can be used npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3 npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error npm ERR! gyp ERR! find Python npm ERR! gyp ERR! find Python ********************************************************** npm ERR! gyp ERR! find Python You need to install the latest version of Python. npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not, npm ERR! gyp ERR! find Python you can try one of the following options: npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe" npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm) npm ERR! gyp ERR! find Python - Set the environment variable PYTHON npm ERR! gyp ERR! find Python - Set the npm configuration variable python: npm ERR! gyp ERR! find Python npm config set python "C:\Path\To\python.exe" npm ERR! gyp ERR! find Python For more information consult the documentation at: npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation npm ERR! gyp ERR! find Python ********************************************************** npm ERR! gyp ERR! find Python npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: Could not find any Python installation to use npm ERR! gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47) npm ERR! gyp ERR! stack at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:159:21) npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18) npm ERR! gyp ERR! stack at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:294:16) npm ERR! gyp ERR! stack at exithandler (node:child_process:427:5) npm ERR! gyp ERR! stack at ChildProcess.errorhandler (node:child_process:439:5) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:514:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:289:12) npm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:476:16) npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21) npm ERR! gyp ERR! System Windows_NT 10.0.19045 npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\HB\\Downloads\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\HB\\Downloads\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108" npm ERR! gyp ERR! cwd C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt npm ERR! gyp ERR! node -v v18.17.1 npm ERR! gyp ERR! node-gyp -v v9.3.1 npm ERR! gyp ERR! not ok npm ERR! node-pre-gyp ERR! build error npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1) npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\node-pre-gyp\lib\util\compile.js:83:29) npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:514:28) npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16) npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5) npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19045 npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HB\\Downloads\\boilerplate-mern-stack-master\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" npm ERR! node-pre-gyp ERR! cwd C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt npm ERR! node-pre-gyp ERR! node -v v18.17.1 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.14.0 npm ERR! node-pre-gyp ERR! not ok npm ERR! A complete log of this run can be found in: C:\Users\HB\AppData\Local\npm-cache\_logs\2023-08-21T07_28_16_741Z-debug-0.log C:\Users\HB\Downloads\boilerplate-mern-stack-master>npm run dev > react-boiler-plate@1.0.0 dev > concurrently "npm run backend" "npm run start --prefix client" node:internal/modules/cjs/loader:1080 throw err; ^ Error: Cannot find module 'C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\concurrently\bin\concurrently.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) at Module._load (node:internal/modules/cjs/loader:922:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v18.17.1
테스트용 데이터를 추가하기 위해 아래와 같은코드를 만들었습니다. @Component @RequiredArgsConstructor public class TestDataInit { private final ItemService itemService; private final ItemRepository itemRepository; /** * 테스트용 데이터 추가 */ @PostConstruct public void init() { itemService.saveItem(new Book("김영한","츨핀시한빛")); itemService.saveItem(new Book("호날두","출판사멩구")); //오류 발생// itemRepository.save(new Book("a","출판사a")); itemRepository.save(new Book("b","출판사b")); } } 한번은 itemService를 이용하여 값을 넣었고 다른 한번은 itemRepository를 이용하여 값을 넣었습니다. 제 단순한 생각으로는 '어차피 itemService는 itemRepository에 바로 위임을하니 바로 itemRepository로 저장하자' 여서 실행했더니 localhost에서 연결을 거부했습니다. 오류가 나왔습니다. <질문> 왜 itemRepository로 저장하면 안되고 itemService로만 저장해야 데이터가 추가되는 지 궁금합니다.