I encountered an error indicating that the classpath of my application needs correction to include compatible versions of the classes org.springframework.boot.SpringApplication and org.springframework.context.ConfigurableApplicationContext.
To resolve this issue, I would:
Solved issue , I need to ensure that my classpath contains only one version of these classes. I can use the Navigate | Class action to check if there are multiple versions of these classes existing in my project. If I find duplicates, I should exclude the duplicated library dependency in the Maven pom.xml
file.
To address the requirements:
spring-boot
to version 2.4.12
for Zuul support.spring
version to 5.3.18
to mitigate the RCE vulnerability.spring-cloud-starter-bootstrap
version 3.0.1
for compatibility with Spring Context.spring-context
dependency.<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.12</version>
<properties>
<java.version>11</java.version>
<log4j2.version>2.16.0</log4j2.version>
<spring.version>5.3.18</spring.version>
</properties>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.4.12</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
<version>2.2.2.RELEASE</version>
</dependency>
You can solve this by downgrading Spring Boot:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.3.RELEASE</version>
</dependency>