Closed waincent closed 5 years ago
I was facing exact same issue and after excluding HikariCP it disappeared. Try following it may work for you too
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
</exclusion>
</exclusions>
</dependency>
I ran into the same issue recently. I think the datasource initializer needs to be refactored to work like the higher level tools like liquibase or flyway.
The current implementation in spring boot is very greedy in that it runs the moment it comes onto scope. Under a cloud environment with cloud config, if the datasource is in refreshscope it will not be ready.
I got around this using liquibase
The same issue in zipkin:
`
<artifactId>zipkin-autoconfigure-storage-mysql</artifactId>
<version>2.9.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>`
@digvijayS Great answer , but can you please tell what will be used for Default Connection Pool if HikariCP is excluded.
You can run testing successfully If you excluded HikariCP on pom file but will fail when try to running application. You can fix this issue by given exactly which data source type via property "spring.datasource.type = [type of datasource]" Hopefully this solution is useful.
After upgrade to Spring Boot v2.1 I have same error.
After exclusion HikariCP Spring Boot can not autowire JPA repositories.
Having the exact same issue Spring Boot 2.1 and Spring Cloud Finchley.SR2
Valid versions are boot 2.0.6 and spring cloud Finchley.SR2 boot 2.1.0 and spring cloud Greenwich.M2
Sorry @spencergibb I was using Finchley and not Greenwich. Problem is solved.
Question
I want add Spring Cloud Security with OAuth2, an exception occurs when initialize the script .
Bug report
Spring Boot Version : 2.0.0.RELEASE Spring Cloud Version: Finchley.M8
Just Spring Boot, the server can initialize a database with schema
the build.gradle:
the application.properties:
the log:
When I add the dependencies with spring cloud
the problem:
Enhancement
I don't know why.