작성
·
370
1
안녕하세요 도움 좀 구하겠습니다.^^
왠만하면 질문을 안하려고 했는데, 도저히 해결이 안되서 질문 올려드려요^^
테스트 db(메모리 db) 강의 이후부터 H2 실제 DB로 붙지 않고 계속 메모리 DB로만 붙는데.
(JpashopApplication 로 테스트가 아니라 실제 main 경로에 있는 소스 컴파일 함에도 불구하고)
여러가지 시도해보다가 도움을 구해봅니다.
main/java/jpabook/jpashop/application.yml
spring:
datasource:
url: jdbc:h2:tcp://localhost/c:\project\spring\jpashop\db\jpashop;
username: sa
password:
driver-class-name: org.h2.Driver
jpa:
hibernate:
ddl-auto: create
properties:
# show_sql: true
format_sql: true
logging:
level:
org.hibernate.SQL: debug
org.hibernate.type: trace
test/resources/application.yml
spring:
datasource:
url: jdbc:h2:mem:test
username: sa
password:
driver-class-name: org.h2.Driver
jpa:
hibernate:
ddl-auto: create
properties:
# show_sql: true
format_sql: true
logging:
level:
org.hibernate.SQL: debug
org.hibernate.type: trace
log
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.4.0)
2020-12-26 19:33:38.857 INFO 6064 --- [ restartedMain] jpabook.jpashop.JpashopApplication : Starting JpashopApplication using Java 11.0.9 on DESKTOP-P2DOCCS with PID 6064 (C:\project\spring\jpashop\out\production\classes started by book in C:\project\spring\jpashop)
2020-12-26 19:33:38.862 INFO 6064 --- [ restartedMain] jpabook.jpashop.JpashopApplication : No active profile set, falling back to default profiles: default
2020-12-26 19:33:38.929 INFO 6064 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2020-12-26 19:33:38.929 INFO 6064 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2020-12-26 19:33:39.931 INFO 6064 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2020-12-26 19:33:39.962 INFO 6064 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 19 ms. Found 0 JPA repository interfaces.
2020-12-26 19:33:40.699 INFO 6064 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-12-26 19:33:40.712 INFO 6064 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-12-26 19:33:40.712 INFO 6064 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.39]
2020-12-26 19:33:40.858 INFO 6064 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-12-26 19:33:40.858 INFO 6064 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1927 ms
2020-12-26 19:33:41.010 INFO 6064 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-12-26 19:33:41.159 INFO 6064 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-12-26 19:33:41.169 INFO 6064 --- [ restartedMain] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:86291ee3-40ea-4319-9124-9d3bf6838987'
답변 3
1
1
맑은바보인데요?^^
붙여 넣으면서도 전혀 의식을 못했네요?
어이 없이 새해 복 많이 받으세요 인사하고 싶어서 그랬나봐요. 바보인 저를 이해해주세요!
그냥 웃기고 싶어서 그랬다고 생각해주세요.
쉬시는 날일텐데 어이 없는 걸로 괴롭혀서 죄송합니다!! 강의 너~~~~~무 잘 듣고 있습니다.
HTTP 강의도 이 로드맵 끝나면 고고!! 하겠습니다.~
늘 감사합니다. 최고!
아참..
main/resources/jpabook/jpashop/application.yml
->
main/resources/application.yml
요렇게요^^ 감사합니다.
죄송해요 함께 덤앤 더머로 만들어 드려서 ㅎㅎ
1
안녕하세요. 맑은요정님^^
다음과 같이 위치를 변경해주세요. (자바 코드는 java 하위에 들어가고 나머지는 resources 하위에 들어가야 합니다.)
변경전
main/java/jpabook/jpashop/application.yml
변경후
main/resources/jpabook/jpashop/application.yml
감사합니다.