{TIL 19} Spring 오류해결 org.springframework.beans.factory.BeanCreationException: Error creating bean with name ............

YeilieY·2022년 10월 7일

항해99

목록 보기
24/27
post-thumbnail

ERROR: org.springframework.beans.factory.BeanCreationException: Error creating bean with name


{ 오류 로그 }

Error starting ApplicationContext. To display the conditions 
report re-run your application with 'debug' enabled.
  2022-10-07 23:27:57.046 ERROR 36396 
  --- [           main] o.s.boot.SpringApplication               
  : Application run failed

  org.springframework.beans.factory.BeanCreationException: Error 
  creating bean with name 'dataSourceScriptDatabaseInitializer' 
  defined in class path resource [org/springframework/boot/
  autoconfigure/sql/init/DataSourceInitializationConfiguration.
  class]: Invocation of init method failed; nested exception is 
  org.springframework.jdbc.datasource.init.
  ScriptStatementFailedException: Failed to execute SQL script 

{ 원인 }

Hibernate가 초기화되기 전에 data.sql이 먼저 실행되어서 발생하는 오류입니다.

{ 해결 방법 }

application.properties 파일에
spring.jpa.defer-datasource-initialization: true
를 입력한다.
profile
Fun_Dev

0개의 댓글