candrews / log4jdbc-spring-boot-starter

Starter for using Log4jdbc with Spring Boot
Apache License 2.0
77 stars 18 forks source link

Error during datasource creation #12

Open denis-markushin opened 5 years ago

denis-markushin commented 5 years ago

I faced the issue during an application starting Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicatorRegistry]: Factory method 'healthIndicatorRegistry' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbHealthIndicator' defined in class path resource [org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicator]: Factory method 'dbHealthIndicator' threw exception; nested exception is java.lang.ClassCastException: net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy cannot be cast to com.zaxxer.hikari.HikariConfig at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]

The lib version:

com.integralblue log4jdbc-spring-boot-starter 2.0.0

Spring Boot version: 2.1.8.RELEASE</spring.boot.version>

I tried to change version to 1.0.2 but unsuccessfully.

Without the dependency the application is started. Please, help.

ibrahimgunes commented 3 years ago

I have same issue too. any suggestion?