티스토리 뷰
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
'Spring > Spring Boot' 카테고리의 다른 글
Junit 테스트시에 INFO 내용 수정 (0) | 2021.07.24 |
---|