[Solved] SpringBoot1.5.10 Project Start Error: Exception in thread “main” java.lang.ClassCastException: class …

SpringBoot 1.5.10, the project starts with two errors

1.@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})

2.Log Warning: Exception in thread “main” java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader ‘bootstrap’)

Details are as follows:

Reason: The pom file has added dependencies such as deployment of.

<!--Hot Start-->
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-devtools</artifactId>
   <optional>true</optional>
</dependency>

Solution:

1: remove this dependency, but the project hot deployment function will no longer be supported

2: upgrade springboot version to 2. X version

Similar Posts: