When I run springboot using springloaded, it throws exception,why it happens?

224 Views Asked by At

When I run springboot using springloaded, it throws exception, why it happens?

The exceptions is below:

[INFO] --- spring-boot-maven-plugin:1.5.13.RELEASE:run (default-cli) @ start ---
[INFO] Attaching agents: [/Users/jack/.m2/repository/org/springframework/springloaded/1.2.8.RELEASE/springloaded-1.2.8.RELEASE.jar]
java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
    at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:110)
    at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
    at sun.misc.Unsafe.defineAnonymousClass(Native Method)
    at java.lang.invoke.InnerClassLambdaMetafactory.spinInnerClass(InnerClassLambdaMetafactory.java:326)
    at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:194)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
    at com.springdemo.Application.main(Application.java:27)
Caused by: java.lang.NullPointerException
    at org.springsource.loaded.agent.SpringLoadedPreProcessor.tryToEnsureSystemClassesInitialized(SpringLoadedPreProcessor.java:373)
    at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:135)
    at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:107)
1

There are 1 best solutions below

0
On

My springboot version is: 2.1.3.RELEASE,I tried to update spring-boot-maven-plugin version from 1.5.13.RELEASE to 2.4.4.RELEASE,then it is solved. It seems that it is a version incompatible problem.

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.13.RELEASE</version>

update to

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.4.RELEASE</version>