Hot start deployment error

 

1. abnormal

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’)

2. solve

When I was doing Springboot real items in How2j, project start SpringBoot Times out of this exception. Internet looking to find information, use hot deployment problems in pom.xml

        <!-- 热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

 

The first time you use hot deployment, understand the concept under: repeated changes in development classes, and other resources page, after each modification is need to restart to take effect, so every time you start a hassle,
wasting a lot of time, we can not restart after the entry into force will be able to modify the code, add the following configuration in pom.xml can achieve this function, we call hot deployment 1 .

  1. The problem first appeared in JDK version is likely to be a problem, I saw my JDK version, I found the JDK version is 11, I put it into a 1.8 version to launch a success. (I am because the system is restored, idae the jdk did not match my own, on the use of JDK11 version of the idea with the default). And from an exception can guess about problems associated with the JDK

2. Online Others say, is SpringBoot version of the problem, I am currently using version 1.5.x, fully supported. SpringBoot2.x I did not test, you can test yourself


  1. Reference blog: HTTPS: //blog.csdn.net/mingxu_W/article/details/93198971 ↩︎

Guess you like

Origin www.cnblogs.com/flunggg/p/12184654.html