I am observing the following error for Sybase database after upgrading Spring boot version from 2.4.5 to 2.6.0.
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer]: Factory method 'integrationDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
application.yaml
spring:
jpa:
hibernate:
ddl-auto: none
generate-ddl: false
naming.physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
databasePlatform: org.hibernate.dialect.SybaseDialect
database: sybase
datasource:
url: jdbc:sybase:Tds:_host_:_port_/_database_
driverClassName: com.sybase.jdbc4.jdbc.SybDriver
username: _username_
password: _password_
Exception stack trace:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-03 14:38:12.106 ERROR 25344 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'integrationDataSourceInitializer' defined in class path resource [org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration$IntegrationJdbcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer]: Factory method 'integrationDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.13.jar!/:5.3.13]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.13.jar!/:5.3.13]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.13.jar!/:5.3.13]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.0.jar!/:2.6.0]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-2.6.0.jar!/:2.6.0]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) ~[spring-boot-2.6.0.jar!/:2.6.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.6.0.jar!/:2.6.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.0.jar!/:2.6.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[spring-boot-2.6.0.jar!/:2.6.0]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer]: Factory method 'integrationDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.13.jar!/:5.3.13]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.13.jar!/:5.3.13]
... 29 common frames omitted
Caused by: java.lang.IllegalStateException: Unable to detect database type
at org.springframework.util.Assert.state(Assert.java:76) ~[spring-core-5.3.13.jar!/:5.3.13]
at org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver.determinePlatform(PlatformPlaceholderDatabaseDriverResolver.java:114) ~[spring-boot-2.6.0.jar!/:2.6.0]
at org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver.resolveAll(PlatformPlaceholderDatabaseDriverResolver.java:103) ~[spring-boot-2.6.0.jar!/:2.6.0]
at org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer.getSettings(IntegrationDataSourceScriptDatabaseInitializer.java:70) ~[spring-boot-autoconfigure-2.6.0.jar!/:2.6.0]
at org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer.<init>(IntegrationDataSourceScriptDatabaseInitializer.java:43) ~[spring-boot-autoconfigure-2.6.0.jar!/:2.6.0]
at org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJdbcConfiguration.integrationDataSourceInitializer(IntegrationAutoConfiguration.java:244) ~[spring-boot-autoconfigure-2.6.0.jar!/:2.6.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.13.jar!/:5.3.13]
... 30 common frames omitted
Comment From: wilkinsona
Thanks for the report. The problem is that we're attempting to resolve the @@platform@@ placeholder in the schema location even though the schema script will never actually be used due to the initialization mode being EMBEDDED.
I think you may be able to work around the problem by defining your own DB initializer bean with empty settings:
@Bean
public IntegrationDataSourceScriptDatabaseInitializer customIntegrationDataSourceInitializer(DataSource dataSource) {
return new IntegrationDataSourceScriptDatabaseInitializer(dataSource, new DatabaseInitializationSettings());
}
Comment From: wilkinsona
We should check the various other initializers to see if they're affected too. Looking at the code, I think a similar problem would also occur with Spring Batch.
Comment From: wilkinsona
We've created a bit of an awkward situation in our consolidation of the various DataSource initializers.
In 2.4, we had DataSourceInitializer which handled applying the users schema and data scripts to the DataSource. We also had AbstractDataSourceInitializer which was a separate base class for DB initialization used with Spring Integration, Quartz, etc. DataSourceInitializer checks to see if it has any scripts to apply first but AbstractDataSourceInitializer checks the database's type (embedded or not) first.
In 2.5, the initializers were consolidated into AbstractScriptDatabaseInitializer. Originally, it checked the database's type (embedded or not) first. This was changed in 2.5.2 to check for scripts to apply first. This was done to align it with DataSourceInitializer.
Unfortunately, this alignment with DataSourceInitializer has brought things out of alignment with AbstractDataSourceInitializer. Checking for scripts to apply first means that @@platform@@ needs to be resolved even if the scripts would never be applied as the initializer isn't enabled.
Comment From: wilkinsona
I've opened #28932 and #28931 for problems that are related to this. Once those have been fixed, we'll review this problem again and see what, if anything, more we need to do.
Comment From: evanjas77
Thank you for looking into this. Is there a likelihood that this will be fixed soon?
Comment From: wilkinsona
Time permitting, we'll hopefully make at least some of the fixes in the next 2.6.x releases but we can't promise anything. Did you try the workaround above?
Comment From: evanjas77
The workaround did not help.
Comment From: wilkinsona
That's surprising. It appears to work for me. An app using Spring Boot 2.6.1 without the workaround fails to start in the way that you have reported:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.6.1)
2021-12-09 09:34:00.384 INFO 35105 --- [ main] com.example.demo.Gh28897Application : Starting Gh28897Application using Java 1.8.0_252 on wilkinsona-a01.vmware.com with PID 35105 (/Users/awilkinson/dev/workspaces/spring-projects/spring-boot/2.6.x/gh-28897/bin/main started by awilkinson in /Users/awilkinson/dev/workspaces/spring-projects/spring-boot/2.6.x/gh-28897)
2021-12-09 09:34:00.386 INFO 35105 --- [ main] com.example.demo.Gh28897Application : No active profile set, falling back to default profiles: default
2021-12-09 09:34:00.870 INFO 35105 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2021-12-09 09:34:00.879 INFO 35105 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2021-12-09 09:34:01.112 INFO 35105 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-12-09 09:34:01.120 INFO 35105 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationChannelResolver' of type [org.springframework.integration.support.channel.BeanFactoryChannelResolver] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-12-09 09:34:01.121 INFO 35105 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-12-09 09:34:01.330 INFO 35105 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-12-09 09:34:01.339 INFO 35105 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-12-09 09:34:01.340 INFO 35105 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.55]
2021-12-09 09:34:01.387 INFO 35105 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-12-09 09:34:01.387 INFO 35105 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 961 ms
2021-12-09 09:34:01.774 INFO 35105 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-12-09 09:34:01.779 WARN 35105 --- [ main] com.zaxxer.hikari.util.DriverDataSource : Registered driver with driverClassName=com.sybase.jdbc4.jdbc.SybDriver was not found, trying direct instantiation.
2021-12-09 09:34:01.780 WARN 35105 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'integrationDataSourceInitializer' defined in class path resource [org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration$IntegrationJdbcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer]: Factory method 'integrationDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
2021-12-09 09:34:01.784 INFO 35105 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-12-09 09:34:01.793 INFO 35105 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-09 09:34:01.844 ERROR 35105 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'integrationDataSourceInitializer' defined in class path resource [org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration$IntegrationJdbcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer]: Factory method 'integrationDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) [spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) [spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) [spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) [spring-boot-2.6.1.jar:2.6.1]
at com.example.demo.Gh28897Application.main(Gh28897Application.java:15) [main/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer]: Factory method 'integrationDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.13.jar:5.3.13]
... 19 common frames omitted
Caused by: java.lang.IllegalStateException: Unable to detect database type
at org.springframework.util.Assert.state(Assert.java:76) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver.determinePlatform(PlatformPlaceholderDatabaseDriverResolver.java:114) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver.resolveAll(PlatformPlaceholderDatabaseDriverResolver.java:103) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer.getSettings(IntegrationDataSourceScriptDatabaseInitializer.java:70) ~[spring-boot-autoconfigure-2.6.1.jar:2.6.1]
at org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer.<init>(IntegrationDataSourceScriptDatabaseInitializer.java:43) ~[spring-boot-autoconfigure-2.6.1.jar:2.6.1]
at org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJdbcConfiguration.integrationDataSourceInitializer(IntegrationAutoConfiguration.java:244) ~[spring-boot-autoconfigure-2.6.1.jar:2.6.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_252]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_252]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_252]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_252]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.13.jar:5.3.13]
... 20 common frames omitted
I then modified the main application class to add the bean for the workaround:
package com.example.demo;
import javax.sql.DataSource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer;
import org.springframework.boot.sql.init.DatabaseInitializationSettings;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class Gh28897Application {
public static void main(String[] args) {
SpringApplication.run(Gh28897Application.class, args);
}
@Bean
public IntegrationDataSourceScriptDatabaseInitializer customIntegrationDataSourceInitializer(DataSource dataSource) {
return new IntegrationDataSourceScriptDatabaseInitializer(dataSource, new DatabaseInitializationSettings());
}
}
The application now starts successfully:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.6.1)
2021-12-09 09:36:25.435 INFO 35140 --- [ main] com.example.demo.Gh28897Application : Starting Gh28897Application using Java 1.8.0_252 on wilkinsona-a01.vmware.com with PID 35140 (/Users/awilkinson/dev/workspaces/spring-projects/spring-boot/2.6.x/gh-28897/bin/main started by awilkinson in /Users/awilkinson/dev/workspaces/spring-projects/spring-boot/2.6.x/gh-28897)
2021-12-09 09:36:25.437 INFO 35140 --- [ main] com.example.demo.Gh28897Application : No active profile set, falling back to default profiles: default
2021-12-09 09:36:25.938 INFO 35140 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2021-12-09 09:36:25.948 INFO 35140 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2021-12-09 09:36:26.204 INFO 35140 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-12-09 09:36:26.213 INFO 35140 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationChannelResolver' of type [org.springframework.integration.support.channel.BeanFactoryChannelResolver] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-12-09 09:36:26.215 INFO 35140 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-12-09 09:36:26.421 INFO 35140 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-12-09 09:36:26.430 INFO 35140 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-12-09 09:36:26.430 INFO 35140 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.55]
2021-12-09 09:36:26.474 INFO 35140 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-12-09 09:36:26.474 INFO 35140 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 993 ms
2021-12-09 09:36:27.032 INFO 35140 --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2021-12-09 09:36:27.032 INFO 35140 --- [ main] o.s.i.channel.PublishSubscribeChannel : Channel 'application.errorChannel' has 1 subscriber(s).
2021-12-09 09:36:27.033 INFO 35140 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started bean '_org.springframework.integration.errorLogger'
2021-12-09 09:36:27.051 INFO 35140 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2021-12-09 09:36:27.060 INFO 35140 --- [ main] com.example.demo.Gh28897Application : Started Gh28897Application in 1.955 seconds (JVM running for 2.264)
If you are seeing different behaviour then it would appear that we don't fully understand the problem that you're seeing. Can you please provide a complete yet minimal sample that reproduces the behaviour that you've described so that we can be sure that we understand exactly what's happening in your case?
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: snicoll
So we've added support for specifying the platform and opting-out for the initialization does not attempt to resolve anything. Given the order that Andy described above, I think that's the best we can do.
With 2.6.2, adding the following property should prevent this from happening:
spring.integration.jdbc.initialize-schema=never
If you rather leave the door open, you can specify the platform instead:
spring.integration.jdbc.platform=sybase
I'll keep this issue open as you've mentioned that the workaround did not help. Can you please help us figure out what we've missed?
Comment From: evanjas77
Apologize for the delayed response. When we apply the workaround for version 2.6.0 or 2.6.1, this error shows up. I am yet to give 2.6.2 a try with the recommended config.
***************************
APPLICATION FAILED TO START
***************************
Description:
The dependencies of some of the beans in the application context form a cycle:
???????
| messagingService (field private org.springframework.cloud.stream.function.StreamBridge <package path>.streamBridge)
? ?
| streamBridgeUtils defined in class path resource [org/springframework/cloud/stream/function/FunctionConfiguration.class]
? ?
| functionCatalog defined in class path resource [org/springframework/cloud/function/context/config/ContextFunctionCatalogAutoConfiguration.class]
???????
Action:
Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.
Comment From: philwebb
@evanjas77 That looks like an issue with either Spring Cloud Function or Spring Cloud Stream. Could you please raise an issue at https://github.com/spring-cloud/spring-cloud-stream/issues. In the meantime, does adding spring.main.allow-circular-references=true to your application.properties allow you to continue?
Comment From: evanjas77
So we've added support for specifying the platform and opting-out for the initialization does not attempt to resolve anything. Given the order that Andy described above, I think that's the best we can do.
With 2.6.2, adding the following property should prevent this from happening:
spring.integration.jdbc.initialize-schema=neverIf you rather leave the door open, you can specify the platform instead:
spring.integration.jdbc.platform=sybaseI'll keep this issue open as you've mentioned that the workaround did not help. Can you please help us figure out what we've missed?
So we've added support for specifying the platform and opting-out for the initialization does not attempt to resolve anything. Given the order that Andy described above, I think that's the best we can do.
With 2.6.2, adding the following property should prevent this from happening:
spring.integration.jdbc.initialize-schema=neverIf you rather leave the door open, you can specify the platform instead:
spring.integration.jdbc.platform=sybaseI'll keep this issue open as you've mentioned that the workaround did not help. Can you please help us figure out what we've missed?
Hi, is 2.6.2 version available in mvn central yet?
Comment From: evanjas77
main.allow-circular-references=true
This setting along with the suggested work around works. Here is the list of all the changes I made
- Used
2.6.0 -
Added the following in application yaml spring: main: allow-circular-references: true
-
Added the following in spring boot application class @Bean public IntegrationDataSourceScriptDatabaseInitializer customIntegrationDataSourceInitializer(DataSource dataSource) { return new IntegrationDataSourceScriptDatabaseInitializer(dataSource, new DatabaseInitializationSettings()); }
Comment From: snicoll
@evanjas77 as Phil said, please raise an issue with the Spring Cloud Stream prioject as setting that property is just a workaround. Spring Boot 2.6.2 is not out yet, but you could give 2.6.2-SNAPSHOT a try. For configuration, please create a project on start.spring.io with that version and the build system you're using.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: evanjas77
@evanjas77 as Phil said, please raise an issue with the Spring Cloud Stream prioject as setting that property is just a workaround. Spring Boot 2.6.2 is not out yet, but you could give
2.6.2-SNAPSHOTa try. For configuration, please create a project on start.spring.io with that version and the build system you're using.
Hi,
I have directly tried the latest 2.6.2 spring boot version. Still seeing the same error. Note that I reverted the work around suggested above. Again mentioning that 2.4.5 version works but not 2.6.2
2021-12-29 10:11:49.363 INFO 16024 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-29 10:11:49.425 ERROR 16024 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'integrationDataSourceInitializer' defined in class path resource [org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration$IntegrationJdbcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer]: Factory method 'integrationDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.14.jar!/:5.3.14]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.14.jar!/:5.3.14]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.14.jar!/:5.3.14]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.2.jar!/:2.6.2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-2.6.2.jar!/:2.6.2]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) ~[spring-boot-2.6.2.jar!/:2.6.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.6.2.jar!/:2.6.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.2.jar!/:2.6.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[spring-boot-2.6.2.jar!/:2.6.2]
at <internal class> ~[classes!/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[internal.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[internal.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[internal.jar:na]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[internal.jar:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer]: Factory method 'integrationDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.14.jar!/:5.3.14]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.14.jar!/:5.3.14]
... 29 common frames omitted
Caused by: java.lang.IllegalStateException: Unable to detect database type
at org.springframework.util.Assert.state(Assert.java:76) ~[spring-core-5.3.14.jar!/:5.3.14]
at org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver.determinePlatform(PlatformPlaceholderDatabaseDriverResolver.java:132) ~[spring-boot-2.6.2.jar!/:2.6.2]
at org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver.lambda$resolveAll$0(PlatformPlaceholderDatabaseDriverResolver.java:96) ~[spring-boot-2.6.2.jar!/:2.6.2]
at org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver.resolveAll(PlatformPlaceholderDatabaseDriverResolver.java:121) ~[spring-boot-2.6.2.jar!/:2.6.2]
at org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver.resolveAll(PlatformPlaceholderDatabaseDriverResolver.java:96) ~[spring-boot-2.6.2.jar!/:2.6.2]
at org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer.resolveSchemaLocations(IntegrationDataSourceScriptDatabaseInitializer.java:83) ~[spring-boot-autoconfigure-2.6.2.jar!/:2.6.2]
at org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer.getSettings(IntegrationDataSourceScriptDatabaseInitializer.java:72) ~[spring-boot-autoconfigure-2.6.2.jar!/:2.6.2]
at org.springframework.boot.autoconfigure.integration.IntegrationDataSourceScriptDatabaseInitializer.<init>(IntegrationDataSourceScriptDatabaseInitializer.java:46) ~[spring-boot-autoconfigure-2.6.2.jar!/:2.6.2]
at org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJdbcConfiguration.integrationDataSourceInitializer(IntegrationAutoConfiguration.java:246) ~[spring-boot-autoconfigure-2.6.2.jar!/:2.6.2]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.14.jar!/:5.3.14]
... 30 common frames omitted
Comment From: snicoll
@evanjas77 it looks like you were expecting to be able to update your app to 2.6.x with no code change at all. Unfortunately, that's not what the current state of affair does. I've already shared two options to use to avoid Spring Boot to try to resolve the database platform.
As Andy stated initially I am not sure there's much else we could be doing, hence me asking you to try and see if that works for you. We've added a feature to trigger database init only if platform-specific schema file exists. In order to do that, we need to resolve the platform if it isn't specified, unless the initialization has been disabled explicitly. This is a new feature that means that you have to either specify the platform, or disable the initialization if you're using a database that we can't detect.
Does the above clarify?
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
Comment From: ikoko7
Hello,
I have same problem. Using Spring Boot 2.6.1 + MySQL What I noticed is that We have 2 databases 1 located on Linux second on Windows Server - both with non standard ports. When I connect to Linux machine I get error but if I connect the Windows Server database everything works.
can you help?
Comment From: wilkinsona
@ikoko7 I don't think you have the same problem. This issue does not apply to MySQL as, unlike Sybase, Spring Boot's DatabaseDriver is aware of MySQL and the form of its JDBC URLs. If you would like some help, please ask a question on Stack Overflow or come and chat with the community on Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.
Comment From: bablushaw23
So we've added support for specifying the platform and opting-out for the initialization does not attempt to resolve anything. Given the order that Andy described above, I think that's the best we can do.
With 2.6.2, adding the following property should prevent this from happening:
spring.integration.jdbc.initialize-schema=neverIf you rather leave the door open, you can specify the platform instead:
spring.integration.jdbc.platform=sybaseI'll keep this issue open as you've mentioned that the workaround did not help. Can you please help us figure out what we've missed?
Thanks @snicoll
It worked for me. I was facing
Factory method 'batchDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
but adding
spring.batch.jdbc.initialize-schema=neversolves it.
Comment From: franciscolimazup
Hey there!
I faced a similar issue with version 2.6.8, during a deployment in QA environment. It doesn't happen locally (and properties differ from each other only by some parameters at spring.datasource.url like sslmode and ssl, which I don't use locally).
Even with properties like spring.jpa.hibernate.ddl-auto=none and spring.sql.init.mode=never it seems that hibernate keeps looking for the schema initialization scripts (schema.sql and data.sql) in a location pointed to the default schema name.
Solved: Anyway, the problem was solved by creating the bean suggested by @wilkinsona 's answer.
This is the exception I was facing before (schema and username were "test_qa"):
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scriptDataSourceInitializer' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceInitializationConfiguration$SharedCredentialsDataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: No schema scripts found at location 'test_qa'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at br.com.my.example.Application.main(Application.java:10)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.IllegalStateException: No schema scripts found at location 'test_qa'
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.getScripts(AbstractScriptDatabaseInitializer.java:128)
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applyScripts(AbstractScriptDatabaseInitializer.java:105)
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applySchemaScripts(AbstractScriptDatabaseInitializer.java:97)
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:75)
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:65)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
... 26 common frames omitted
Comment From: wilkinsona
@franciscolimazup That looks like a different problem. This issue was specifically about a failure to detect the database's type when using Sybase. Your error, "No schema scripts found at location 'test_qa'", looks like some misconfiguration to me. It would appear that, in your QA environment, something has configured the location of the scripts that should initialise your database's schema with the name of the schema instead. Perhaps there's an environment variable or some profile-specific configuration that's only in effect in your QA environment? You could use the actuator's env endpoint to diagnose this.
Comment From: franciscolimazup
@wilkinsona Yes, it does look like a different problem as the exception and message are different. But I think the core problem could be a failure to detect and set the configs specified by the application properties file, because I tried to set several properties (reading and following the doc) for preventing Hibernate from initializing database and it didn't make any difference.
The doc says that Hibernate takes different default values depending on schema manager detection and on whether database is embedded, and it looks at Connection type and JDBC URL. As the URL is the main difference between QA and Local config properties here, I think it could be impacting or overriding some configs.
There are many other projects here with similar properties in their QA and Prod environments, but with version 2.3.x, and they don't present this problem! The supposed failure could be the cause for both database's type detection and schema script detection failures.
Nevertheless I'll double check the environment variables.
Comment From: lechatthecat
It seems, this error is thrown also when db is not working, for example, when minikube (and DB pod in k8s) is not started.
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.batch.BatchDataSourceScriptDatabaseInitializer]: Factory method 'batchDataSourceInitializer' threw exception with message: Unable to detect database type
Caused by: java.lang.IllegalStateException: Unable to detect database type