java, spring

WARN 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

isaac.kim 2023. 5. 8.
728x90
반응형

[오류 해결]

Spring Boot 프로젝트를 실행 시켰을 때 다음과 같은 오류가 나타날 때가 있습니다.

 

# 오류

WARN 36868 --- [  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

 

 

 

반응형

# 해결

application.properties 혹은 application.yml 파일에서

spring.jpa.open-in-view를 false로 설정해주면 경고 메시지가 사라집니다.

 

 

 

src/main/resources/application.properties

src/main/resources/application.yml

spring:
  jpa:
    open-in-view: false

 

위 설정을 하고 다시 실행하니 경고 메시지가 안 나타나는 것을 확인할 수 있습니다.

 

아래 다른 경고 메시지가 보이는 데 다른 오류 이므로 다른 글에서 다루도록 하겠습니다.

728x90
반응형