23.12.31 15:18 작성
·
1.5K
0
안녕하세요 H2 DB 테이블 생성이 안되는데, 스프링부트를 실행하면 에러도 안납니다.
H2 연결되어 있습니다.
처음에 jpashop.mv.db 도 잘 생성되었습니다.
스프링부트를 실행하면 어떤 에러도 없지만, DB테이블이 만들어 지는 문구가 하나도 없습니다
H2 콘솔창도 DB 테이블 한개도 없이 아주 깨끗합니다.
어떻게 해결할 수 있을까요??
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v3.1.7)
2023-12-31T15:17:34.731+09:00 INFO 13760 --- [ restartedMain] jpabook.jpashop.JpashopApplication : Starting JpashopApplication using Java 21.0.1 with PID 13760 (C:\Users\dqk86\Downloads\jpashop\out\production\classes started by dqk86 in C:\Users\dqk86\Downloads\jpashop)
2023-12-31T15:17:34.734+09:00 INFO 13760 --- [ restartedMain] jpabook.jpashop.JpashopApplication : No active profile set, falling back to 1 default profile: "default"
2023-12-31T15:17:34.825+09:00 INFO 13760 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-12-31T15:17:34.825+09:00 INFO 13760 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-12-31T15:17:35.417+09:00 INFO 13760 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-12-31T15:17:35.437+09:00 INFO 13760 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 12 ms. Found 0 JPA repository interfaces.
2023-12-31T15:17:36.132+09:00 INFO 13760 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2023-12-31T15:17:36.147+09:00 INFO 13760 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-12-31T15:17:36.148+09:00 INFO 13760 --- [ restartedMain] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.17]
2023-12-31T15:17:36.213+09:00 INFO 13760 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-12-31T15:17:36.214+09:00 INFO 13760 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1387 ms
2023-12-31T15:17:36.254+09:00 INFO 13760 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2023-12-31T15:17:36.443+09:00 INFO 13760 --- [ restartedMain] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:8b0a757c-2d15-4737-adab-1dbaee374f3e user=SA
2023-12-31T15:17:36.445+09:00 INFO 13760 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2023-12-31T15:17:36.455+09:00 INFO 13760 --- [ restartedMain] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:8b0a757c-2d15-4737-adab-1dbaee374f3e'
2023-12-31T15:17:36.698+09:00 INFO 13760 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-12-31T15:17:36.806+09:00 INFO 13760 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.2.17.Final
2023-12-31T15:17:36.809+09:00 INFO 13760 --- [ restartedMain] org.hibernate.cfg.Environment : HHH000406: Using bytecode reflection optimizer
2023-12-31T15:17:37.052+09:00 INFO 13760 --- [ restartedMain] o.s.o.j.p.SpringPersistenceUnitInfo : No LoadTimeWeaver setup: ignoring JPA class transformer
2023-12-31T15:17:37.941+09:00 INFO 13760 --- [ restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)
2023-12-31T15:17:37.984+09:00 INFO 13760 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2023-12-31T15:17:38.027+09:00 WARN 13760 --- [ restartedMain] 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-12-31T15:17:38.195+09:00 INFO 13760 --- [ restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]
2023-12-31T15:17:38.552+09:00 INFO 13760 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2023-12-31T15:17:38.576+09:00 INFO 13760 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2023-12-31T15:17:38.587+09:00 INFO 13760 --- [ restartedMain] jpabook.jpashop.JpashopApplication : Started JpashopApplication in 4.164 seconds (process running for 4.578)
답변 3
0
0
2023. 12. 31. 16:47
spring:
datasource:
url: jdbc:h2:tcp://localhost/~/jpashop;
username: sa
password:
driver-class-name: org.h2.Driver
jpa:
hibernate:
ddl-auto: update
properties:
hibernate:
# show_sql: true
format_sql: true
logging:
level:
org.hibernate.SQL: debug
띄어쓰기 모두 라인 맞춰져있는 것 같은데 잘못된건가요?
0
2023. 12. 31. 15:45
네 3가지 모두 읽어보았습니다. 저는 3가지 모두에 해당되지 않는 것 같습니다.
ddl-auto create로 설정되어 있습니다.
yml 파일에 띄어쓰기도 잘되어있습니다.(Warning이 없습니다)
entity들은 모두 하위 클래스에 있습니다. 아래 사진 첨부하겠습니다. domain package와 JapshopApplication class는 동일선상에 있습니다.
다른 해결책은 없을까요?
2024. 09. 25. 01:14
안녕하세요. 혁짱님, 공식 서포터즈 OMG입니다.
아래 링크를 참고하여 프로젝트 코드를 공유해주세요.
https://bit.ly/3fX6ygx
주의: 업로드시 링크에 있는 권한 문제 꼭 확인해주세요
추가로 다음 내용도 코멘트 부탁드립니다.
1. 문제 영역을 실행할 수 있는 방법
2. 문제가 어떻게 나타나는지에 대한 상세한 설명 (오류 화면, 오류 로그 포함)
링크: 공식 서포터즈
링크: 자주하는 질문
감사합니다.