Maven dependency conflicts in spring cloud - spring-boot

When i try to add the spring cloud dependencies my project gives the below errors which I am not able to solve because of some version conflicts.Please Help me identify the issue and solve this.
Hi have a spring boot project with:
pom.xml
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
<version>1.4.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.9.8</version>
</dependency>
</dependencies>
I am getting the following errors with Loaded default TestExecutionListener class names from location exception and [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist
exceptions.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time
elapsed: 2.692 s <<< FAILURE! - in
com.package.packageApplicationTests
[ERROR] contextLoads(com.package.packageApplicationTests) Time
elapsed: 0.002 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by:
org.springframework.beans.factory.BeanDefinitionStoreException:
Failed to process import candidates for configuration class
[com.package.packageApplication]; nested exception is
java.io.FileNotFoundException: class path resource
org/springframework/boot/autoconfigure
/web/ServerPropertiesAutoConfiguration.class cannot be opened
because it does not exist
Caused by: java.io.FileNotFoundException: class path resource
org/springframework/boot/autoconfigure/web/
ServerPropertiesAutoConfiguration.class cannot be opened because it
does not exist

Have you tried to remove the version tag following the springboot head version? Looks like Some of your dependencies is adding some incompatible dependencies between version.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>

Related

Executing spring web client causing DeferringLoadBalancerExchangeFilterFunction non qualifying bean exception

I have created spring boot project with Spring WebFlux. Idea is to learn the Spring WebClient and related stuff. On start of application, I am getting below error
Error creating bean with name 'loadBalancerWebClientBuilderBeanPostProcessor' defined in class path resource [org/springframework/cloud/client/loadbalancer/reactive/LoadBalancerBeanPostProcessorAutoConfiguration.class]:
Unsatisfied dependency expressed through method 'loadBalancerWebClientBuilderBeanPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type 'org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction<?>' available: expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations: {}
I have dependencies like spring-cloud-dependencies/spring-boot-starter*/spring-cloud-context in my maven dependencies. Error just giving information that DeferrringLoadBalancerExchangeFilterFunction is not available, I have tried to inject it using #Bean in my configuration class. But error still persists. Please advice
Posting dependencies in pom.xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Hoxton.SR9</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-kubernetes-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-kubernetes-all</artifactId>
</dependency>
<!-- 3rd Party Dependencies -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-secrets-spring-boot-starter</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!--Dependency for registering your app as a Spring Boot Admin Client-->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-dependencies</artifactId>
<version>2.2.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
</dependency>
<!--spring dependencies-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--swagger dependency-->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.4.4</version>
</dependency>
<!--3rd party dependencies-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>jwks-rsa</artifactId>
<version>0.14.0</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-gson</artifactId>
<version>9.3.1</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.6</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.6</version>
</dependency>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
</dependency>
Please note that i use feign client as well as web client in my code. Not sure whether that has an impact
Adding dependency to org.springframework.cloud:spring-cloud-starter-loadbalancer helped in my case, as adviced by #OlgaMaciaszek
Looks like I faced the problem with similar root cause.
To use Spring Cloud with Spring Boot you have to respect versions compatibility.
I had a project based on Spring Boot (2.3.12.RELEASE) and Spring Cloud (Hoxton.SR11) which is fine.
But I also tried to use the latest version of com.playtika.reactivefeign:feign-reactive:3.0.3 which actually relies on Spring Cloud (2020.0.x)
As a result I've faced the same error
Error creating bean with name 'loadBalancerWebClientBuilderBeanPostProcessor'`
In my case I've downgraded reactivefeign version to 2.0.31
I have resolved this by removing unnecessary dependency which was causing issues for this issue that is :
'org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction' that could not be found.
<artifactId>spring-boot-starter-webflux</artifactId>

Spring boot 2.0.6 -

I am upgrading my app to Spring boot 2.0.6. Maven builds and runs, the unit tests fine. At runtime, while starting up the application container though
I keep seeing this error:-
2018-11-21 11:55:30,190 WARN
 o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext -
Exception encountered during context initialization - cancelling
refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'methodValidationPostProcessor' defined in
class path resource
[org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.validation.beanvalidation.MethodValidationPostProcessor]:
Factory method 'methodValidationPostProcessor' threw exception; nested
exception is java.lang.StackOverflowError.
The dependencies in my parent pom are as follows -
`<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
</parent>
<properties>
<capitalone.project.version>3.0.1</capitalone.project.version>
<jackson.version>2.9.7</jackson.version>
<junit.version>4.12</junit.version>
<junit-platform.version>1.1.0</junit-platform.version>
<sl4j.version>1.7.25</sl4j.version>
<spring-data-releasetrain.version>Lovelace-RELEASE</spring-data-releasetrain.version>
<mongodb.version>3.8.2</mongodb.version>
<pmd.version>3.11.0</pmd.version>
<jacoco.version>0.8.2</jacoco.version>
<docker.useConfigFile>false</docker.useConfigFile>
<mockito.version>2.23.0</mockito.version>
<docker-maven-plugin.version>1.2.0</docker-maven-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<sonar-maven-plugin.version>3.5.0.1254</sonar-maven-plugin.version>
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<commons-beanutils.version>1.9.3</commons-beanutils.version>
<hibernate-validator.version>6.0.13.Final</hibernate-validator.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${sl4j.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-properties-migrator</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.0.6.RELEASE</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>${spring-data-releasetrain.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.RELEASE</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>`
The pom of my project inherits the above dependencies as it is its parent. Additionally it has the following dependencies defined in it -
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hamcrest.version>1.3</hamcrest.version>
<querydsl.version>4.2.1</querydsl.version>
</properties>
<dependencies>
<dependency>
<groupId>com.capitalone.dashboard</groupId>
<artifactId>core</artifactId>
<version>${capitalone.project.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-mongodb</artifactId>
<version>${querydsl.version}</version>
<exclusions>
<exclusion>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>com.github.fakemongo</groupId>
<artifactId>fongo</artifactId>
<version>2.0.3</version>
</dependency>
</dependencies>
I have run out of options now. It looks like its going into some kind of cyclical dependency but not sure what will resolve it. Any help is greatly appreciated.
Just so it might help someone else, I found this post with almost the same stacktrace - https://github.com/ulisesbocchio/jasypt-spring-boot/issues/50
For me, the problem persisted with Spring boot 2.1.0.RELEASE as well as all the other versions specified in that github forum post.
Eventually, when I ran the application as a normal Spring Boot App via intellij (Yes, Run as Application), it started throwing a different error in the console suggesting that the property names in my properties files were in camel case and they had to be all in lowercase and could have dash(-). After I changed all the property names, it could instantiate the bean alright and the application started up.

Redis connection is failed

I'd like to work with Redis for manipulating sessions.But I get failure when running the spring boot app.So I guess that this error is coming from maven dependencies especially version conflicts.
Here is my maven dependencies:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.7.0.RELEASE</version>
</dependency>
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>5.0.0.RELEASE</version>
</dependency>
</dependencies>
Notice that I added two dependencies in above pom.xml which there artifactId are spring-session-data-redis and lettuce-core.These dependencies are respectively responsible for Redis connection and ensuring thread safety for session connections.
When I run the spring boot app, I get the belowed error:
APPLICATION FAILED TO START
Description:
An attempt was made to call the method org.springframework.data.redis.connection.RedisConnection.getConfig(Ljava/lang/String;)Ljava/util/List; but it does not exist. Its class, org.springframework.data.redis.connection.RedisConnection, is available from the following locations:
jar:file:/C:/Users/aoutir/.m2/repository/org/springframework/data/spring-data-redis/2.0.10.RELEASE/spring-data-redis-2.0.10.RELEASE.jar!/org/springframework/data/redis/connection/RedisConnection.class
It was loaded from the following location:
file:/C:/Users/aoutir/.m2/repository/org/springframework/data/spring-data-redis/2.0.10.RELEASE/spring-data-redis-2.0.10.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.redis.connection.RedisConnection
Please any help is very appreciated,thanks in advance for your reply.
I have spent a whole day to resolve the exactly same issue. And after a whole day R&D, I found the solution.
dependencies {
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
implementation('org.springframework.boot:spring-boot-starter-data-rest')
implementation('org.springframework.boot:spring-boot-starter-web')
implementation('org.springframework.boot:spring-boot-starter-security')
implementation('org.springframework.boot:spring-boot-starter-data-redis')
implementation('org.springframework.session:spring-session-data-redis')
runtimeOnly('org.springframework.boot:spring-boot-devtools')
testImplementation('org.springframework.boot:spring-boot-starter-test')
runtimeOnly('org.flywaydb:flyway-core')
runtimeOnly('com.h2database:h2')
// runtimeOnly('mysql:mysql-connector-java')
}
Use 'spring-boot-starter-data-redis' and 'spring-session-data-redis'.
Remove lettuse dependency as it is included in spring-boot-starter-data-redis as dependency.
Here is your dependencies:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
Simply delete the explicit version for spring-session-data-redis and go with the version from the spring boot parent pom.
If you want to change the version of spring-session-data-redis, you have to ensure that none of the transitive dependencies is managed by the parent pom. If I downgrade to version 1.3 (version 1.7 could not be found) I end up with the following version mismatch as revealed by mvn -X dependency:tree:
[ESC[1;36mDEBUGESC[m] org.springframework.session:spring-session-data-redis:jar:1.3.3.RELEASE:compile
[ESC[1;36mDEBUGESC[m] org.apache.commons:commons-pool2:jar:2.5.0:compile (version managed from 2.4.2)
[ESC[1;36mDEBUGESC[m] org.springframework.data:spring-data-redis:jar:2.0.10.RELEASE:compile (version managed from 1.7.10.RELEASE)
Please replace the dependency
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.7.0.RELEASE</version>
</dependency>
with
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
</dependency>
The version management is done automatically and the started will initialize the redis cache.

Failed to load driver class oracle.jdbc.OracleDriver in either of HikariConfig class loader or Thread context

I'm working with Spring for the first time and trying to set it up so that my code can access an Oracle database. I have the following configuration in my application.properties:
spring.datasource.url=jdbc:oracle:thin:#140.192.30.237:1521:def
spring.datasource.username=<username>
spring.datasource.password=<password>
spring.datasource.driver.class-name=oracle.jdbc.driver.OracleDriver
My pom.xml contains the following dependencies:
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
Yet I get the following error and am not sure how to solve it, I"ve found similar ones from searching but none that have solved my problem:
Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:
Property: driverclassname
Value: oracle.jdbc.OracleDriver
Origin: "driverClassName" from property source "source"
Reason: Failed to load driver class oracle.jdbc.OracleDriver in either of HikariConfig class loader or Thread context classloader
Action:
Update your application's configuration
Thanks for any tips to solve this.
As its mentioned in your error the problem is with your configuration.
Following line,
spring.datasource.driver.class-name=oracle.jdbc.driver.OracleDriver
should change as,
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
Note that its not driver.class-name, instead its driver-class-name
Add below dependency and repository in the pom
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<repositories>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
</repositories>
Also add the following properties in the application.properties
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.url=jdbc:oracle:thin:#localhost:1521:xe(SID)
spring.datasource.username=system
spring.datasource.password=pw
Try on the project directory pom.xml file in in command promt or your ide.
mvn clean install
I have the same probleme
Add this dependence to POM.xml file
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>runtime</scope>
</dependency>
Below dependency to POM should work.
<!-- https://mvnrepository.com/artifact/oracle/ojdbc6 -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4</version>
</dependency>

spring boot compilation fails

after a "maven clean" my spring boot project doesn't compile anymore
RunAs --> Spring Boot App
Impossible to find or load the main class com.in28minutes.springboot.rest.example.springboot2restservicebasic.SpringBoot2RestServiceBasicApplication
so from the terminal: mvn spring-boot:run (or spring-boot:repackage )
Compilation failure
[ERROR] /D:/eclipse-workspace/spring-boot-2-rest-service-basic/spring-boot-2-rest-service-basic/src/main/java/com/in28minutes/springboot/rest/example/springboot2restservicebasic
/api/StudentResource.java:[18,45] package net.bytebuddy.implementation.bytecode does not exist
pom.xml
...
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
..
Have you put the dependency below in your project's pom.xml?
```xml
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.7.11</version>
</dependency>
```
version can be another you want.

Resources