inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발

강의 소스 코드

member테이블 생성.강의-JPA와 DB 설정, 동작확인

2672

heidi

작성한 질문수 3

0

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.

1. 강의 내용과 관련된 질문을 남겨주세요.
2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.
(자주 하는 질문 링크: https://bit.ly/3fX6ygx)
3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.
(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)

질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.
=========================================
[질문 템플릿]
1. 강의 내용과 관련된 질문인가요? (예/아니오)
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)
3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)

[질문 내용]
여기에 질문 내용을 남겨주세요.

 

2-1.PNG->여기에 member 테이블이 생성이 안돼요.

 

0.PNG01.PNG02.PNG03.PNG04.PNG05.PNG06.PNG07.PNG캡처.PNG

memberRepository

->

 

Download https://repo.maven.apache.org/maven2/org/projectlombok/lombok/1.18.22/lombok-1.18.22.pom, took 721 ms (1.48 kB)

Download https://repo.maven.apache.org/maven2/org/projectlombok/lombok/1.18.22/lombok-1.18.22.jar, took 1 s 605 ms (1.95 MB)

> Task :compileJava

> Task :processResources UP-TO-DATE

> Task :classes

> Task :compileTestJava UP-TO-DATE

> Task :processTestResources NO-SOURCE

> Task :testClasses UP-TO-DATE

> Task :test

06:07:24.485 [Test worker] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [MemberRepositoryTest]: using SpringBootContextLoader

06:07:24.497 [Test worker] DEBUG org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [jpabook.jpashop.MemberRepositoryTest]: no resource found for suffixes {-context.xml, Context.groovy}.

06:07:24.499 [Test worker] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [jpabook.jpashop.MemberRepositoryTest]: MemberRepositoryTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.

06:07:24.552 [Test worker] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using ContextCustomizers for test class [MemberRepositoryTest]: [DisableObservabilityContextCustomizer, PropertyMappingContextCustomizer, Customizer, ExcludeFilterContextCustomizer, DuplicateJsonObjectContextCustomizer, MockitoContextCustomizer, TestRestTemplateContextCustomizer]

06:07:24.654 [Test worker] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\jpashop\build\classes\java\main\jpabook\jpashop\JpashopApplication.class]

06:07:24.659 [Test worker] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration jpabook.jpashop.JpashopApplication for test class jpabook.jpashop.MemberRepositoryTest

06:07:24.770 [Test worker] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners for test class [MemberRepositoryTest]: [ServletTestExecutionListener, DirtiesContextBeforeModesTestExecutionListener, ApplicationEventsTestExecutionListener, MockitoTestExecutionListener, DependencyInjectionTestExecutionListener, DirtiesContextTestExecutionListener, TransactionalTestExecutionListener, SqlScriptsTestExecutionListener, EventPublishingTestExecutionListener, RestDocsTestExecutionListener, MockRestServiceServerResetTestExecutionListener, MockMvcPrintOnlyOnFailureTestExecutionListener, WebDriverTestExecutionListener, MockWebServiceServerTestExecutionListener, ResetMocksTestExecutionListener]

06:07:24.772 [Test worker] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: class [MemberRepositoryTest], class annotated with @DirtiesContext [false] with mode [null]

. ____ _

/\\ / ___'_ __ (_)_ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

\\/ ___)| |_)| | | | | || (_| | ) ) ) )

' |____| .__|_| |_|_| |_\__, | / / / /

=========|_|==============|___/=/_/_/_/

:: Spring Boot :: (v3.0.1)

2023-01-10T06:07:25.056+09:00 INFO 7064 --- [ Test worker] jpabook.jpashop.MemberRepositoryTest : Starting MemberRepositoryTest using Java 17.0.5 with PID 7064 (started by PC in C:\jpashop)

2023-01-10T06:07:25.057+09:00 INFO 7064 --- [ Test worker] jpabook.jpashop.MemberRepositoryTest : No active profile set, falling back to 1 default profile: "default"

2023-01-10T06:07:25.773+09:00 INFO 7064 --- [ Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.

2023-01-10T06:07:25.801+09:00 INFO 7064 --- [ Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 16 ms. Found 0 JPA repository interfaces.

2023-01-10T06:07:26.337+09:00 INFO 7064 --- [ Test worker] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...

2023-01-10T06:07:26.672+09:00 INFO 7064 --- [ Test worker] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:fa15755d-1779-4e39-8761-6f8666e6b6b0 user=SA

2023-01-10T06:07:26.675+09:00 INFO 7064 --- [ Test worker] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.

2023-01-10T06:07:26.741+09:00 INFO 7064 --- [ Test worker] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]

2023-01-10T06:07:26.833+09:00 INFO 7064 --- [ Test worker] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.1.6.Final

2023-01-10T06:07:27.138+09:00 WARN 7064 --- [ Test worker] org.hibernate.orm.deprecation : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead

2023-01-10T06:07:27.378+09:00 INFO 7064 --- [ Test worker] SQL dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect

2023-01-10T06:07:28.468+09:00 INFO 7064 --- [ Test worker] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]

2023-01-10T06:07:28.487+09:00 INFO 7064 --- [ Test worker] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'

2023-01-10T06:07:28.768+09:00 WARN 7064 --- [ Test worker] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning

2023-01-10T06:07:29.060+09:00 INFO 7064 --- [ Test worker] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]

2023-01-10T06:07:29.360+09:00 INFO 7064 --- [ Test worker] jpabook.jpashop.MemberRepositoryTest : Started MemberRepositoryTest in 4.529 seconds (process running for 6.173)

2023-01-10T06:07:29.899+09:00 INFO 7064 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'

2023-01-10T06:07:29.899+09:00 INFO 7064 --- [ionShutdownHook] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'

2023-01-10T06:07:29.902+09:00 INFO 7064 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...

2023-01-10T06:07:29.905+09:00 INFO 7064 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.

BUILD SUCCESSFUL in 12s

4 actionable tasks: 2 executed, 2 up-to-date

오전 6:07:30: Execution finished ':test --tests "jpabook.jpashop.MemberRepositoryTest"'.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

spring java spring-boot JPA 웹앱

답변 1

0

OMG

안녕하세요. heidi님, 공식 서포터즈 OMG입니다.
.

아래 표기한 실행버튼으로 확인해보시겠어요?

image
.
감사합니다.

 

0

heidi

그렇게 했는데도 안돼요.. 속 터질 것 같아요 도와주세요ㅠㅠ

0

OMG

실행 과정반드시 전체화면 캡쳐 인텔리제이 콘솔창 중 시작시점이 보이게 화면캡쳐하여 올려주세요.

실행과정이 담겨있어야 합니다.

0

heidi

https://drive.google.com/drive/folders/1fKTeFO1_YNUthl7mGNw1YR6VKR8nh2py?usp=sharing

0

OMG

코드 문제는 아닌 것으로 예상하였고 어떻게 실행했는지 확인이 필요하여 문의드렸는데, 링크를 주셨으니 확인해보려했으나

접속이 불가합니다.

image

image

 

업로드 방법을 확인해주세요.

질문용 파일 업로드 - 구글 드라이브 업로드

Q: 구글 드라이브 업로드 방법


step1) https://www.google.com/intl/ko_KR/drive/ 에 접속.
step2) 드라이브로 이동

step3) 프로젝트를 "전체" 압축 후 압축파일을 드라이브 메뉴로 이동

※ 직접 강의를 보면서 따라한 "프로젝트"를 압축해서 보내주세요. 문제가 발생하는 자바 파일 1개 혹은 jar 파일 등을 보낼 경우 도움 드릴 수 없습니다.

 

step4) 업로드 성공하면 "공유" 선택

step5) 링크복사 (링크 보기의 내용 확인)

step6) 크롬 or 엣지에서 ctrl + shift + n을 눌러 시크릿 모드로 진입 후 해당 링크를 입력하여 아래와 같은 페이지가 출력되는지 확인. 정상 출력되면 링크를 질문글에 공유.


0

heidi

다시 압축 파일로 구글에 올렸습니다!

제가 윈도우 사용해서 h2 들어갈 때, cmd창에 h2.bat이라고 쳐서 들어가는데 혹시 이게 문제일까요? 강의에서처럼 h2.sh라고 치면 아무 창도 안뜨고 h2.bat이라고 치면 h2에 들어져요.

jdbc url은 jdbc:h2:tcp://localhost/~/jpashop 라고 쳤어요.

0

heidi

https://drive.google.com/file/d/1RJENiHOR0GXNP97yC9LZfvn3dxVzAN0s/view?usp=sharing

0

OMG

제가 윈도우 사용해서 h2 들어갈 때, cmd창에 h2.bat이라고 쳐서 들어가는데 혹시 이게 문제일까요? 강의에서처럼 h2.sh라고 치면 아무 창도 안뜨고 h2.bat이라고 치면 h2에 들어져요.

=>

윈도우는 h2.bat으로 실행시키는게 맞습니다. 문제 없어보여요

0

OMG

https://drive.google.com/file/d/1RJENiHOR0GXNP97yC9LZfvn3dxVzAN0s/view?usp=sharing

링크 접속이 동일하게 되지 않습니다. 링크있는 사용자에게 허용하는 권한을 지정해주세요.

0

heidi

수정했어요!!

0

OMG

image

application.yml이 templates 안에 있네요

바깥으로 옮기면 될거에요

OrderServiceTest 상문주문 테스트 시 update 쿼리 문의

0

24

1

sdk 설정 오류

0

59

2

오탈자 - @Transactional

0

58

1

src/test/resources 테스트 경로 문제

0

54

1

상품 등록후 H2 db 출력 순서 바꿀 수 있나요?

0

67

1

MemberRepositoryTest 실행오류

0

83

1

boot 4.x >>> trasasction rolled back log & p6spy(영한님, 수업 자료 업데이트 해주시면 감사하겠습니다!!)

1

187

2

강의 마지막 QueryDSL 사용 부분 질문있습니다

1

146

2

클라이언트에서 isbn과 author 수정 요청을 한 경우에 대해 질문드립니다.

0

55

1

도메인 모델 패턴 vs 트랜잭션 스크립트 패턴

0

77

1

기본 생성자

0

62

1

h2 DB 연결시 jdbc url 변경 이유가 궁금합니다.

0

104

1

멤버서비스테스트 부분에서 막힙니다.

0

169

4

실무에서도 EntityManager를 이용해서 많이 작업하는 편일까요?

0

119

1

초반에 h2 다운로드 과정 꼭 필요한가요?

0

123

2

자신 필드에도 get으로 접근하는 이유가 있을까요?

0

115

1

24분 27초 연관관계 편의 메서드 위치

0

115

1

단건 주문만 가능하게 한건 의도한 부분이신가요?

0

112

2

빌드 툴, Gradle

0

61

1

h2연결은 된 것 같은데 엔티티 테이블까지 작성 후 확인해보아도 테이블이 안보입니다

0

78

2

Repository에서 EntityManager 주입 방식 차이

0

91

1

롬복과 사용자 정의 setter 메서드

0

74

1

주문 목록 조회 fetch join 질문드립니다

0

85

1

dirty checking 질문드립니다.

0

84

1