• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

실행 에러 질문..

21.04.28 14:22 작성 조회수 1.14k

0

테스트 코드 실행으로만 따라오다가  실제 서버를 띄우고 마지막으로 살펴보려하니  아래와 같은 Err가 발생합니다 ... 

 [           main] h.hellospring.HelloSpringApplication     : Started HelloSpringApplication in 11.777 seconds (JVM running for 13.962)
[extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
[extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
[extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed. 

EntityManager   관련하여 문제가 발생해서 바로 죽는거같은데.. 해결방법이 있을까요..?

# dependency

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
	implementation 'org.springframework.boot:spring-boot-starter-web'
//	implementation 'org.springframework.boot:spring-boot-starter-jdbc'
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	runtimeOnly 'com.h2database:h2'
	providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
	testImplementation('org.springframework.boot:spring-boot-starter-test') {
		exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
	}
}

# apllication.properties

spring.datasource.url=jdbc:h2:tcp://localhost/~/test
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=none

답변 1

답변을 작성해보세요.

2

Omnibus님의 프로필

Omnibus

2021.04.28

안녕하세요, dksworhkd123 님.

의존성 목록을 보니 프로젝트 생성 시 패키징을 Jar가 아닌 War로 선택하신 것으로 보이네요.
해당 의존성을 주석 처리 또는 삭제하시고 다시 실행해보시기 바랍니다.

providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'


조금이나마 도움이 되었으면 좋겠습니다.

답변 감사드립니다!  강의를 보며 이것저것 설정을 변경하는과정에서 외부라이브러리가 꼬인거 같습니다... 기존코드를 그대로 두고  프로젝트 루트폴더 내 .gradle, gradle  삭제후 다시 라이브러리 땡겨와서 해결했습니다..감사합니다!