티스토리 뷰

728x90

spring boot 2.5.0 이상 버전에서 바뀐 내용으로 오류 

 

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 statement #1 of URL [file:/C:/intellj/bookmanger/bookmanger/build/resources/test/data.sql]: call next value for hibernate_sequence;

nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Sequence "HIBERNATE_SEQException encountered during context initialization - cancelling refresh attempt: 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 statement #1 of URL [file:/C:/intellj/bookmanger/bookmanger/build/resources/test/data.sql]: call next value for hibernate_sequence; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Sequence "HIBERNATE_SEQUENCE" not found; SQL statement: call next value for hibernate_sequence [90036-200] SQL statement: call next value for hibernate_sequence [90036-200]

 

application.yml 또는 application.properties 에 해당 내용을 추가해야함.

# application.yml or yaml
spring:
  jpa:
    defer-datasource-initialization: true
    
    
# application.properties
spring.jpa.defer-datasource-initialization= true

 

참고 : https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.5-Release-Notes#hibernate-and-datasql

'Spring > Spring Boot' 카테고리의 다른 글

Junit 테스트시에 INFO 내용 수정  (0) 2021.07.24
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함