Eclipse的线程“restartedMain”中出现异常

ubby3x7f  于 2022-11-04  发布在  Eclipse
关注(0)|答案(1)|浏览(265)

我得到下面的错误时,Spring Boot 应用程序启动与eclipse(STS)。但当我启动应用程序外部与java -jar命令,它成功启动。我如何摆脱以下异常与eclipse?

Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.AbstractMethodError
    at org.springframework.context.event.AbstractApplicationEventMulticaster.supportsEvent(AbstractApplicationEventMulticaster.java:282)
    at org.springframework.context.event.AbstractApplicationEventMulticaster.retrieveApplicationListeners(AbstractApplicationEventMulticaster.java:214)
xe55xuns

xe55xuns1#

此问题可能是由于自动配置造成的。请尝试从pom.xml中删除spring-boot-devtools依赖项

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

这似乎对我起了作用。

相关问题