Spring Boot 线程“main”中出现异常java.lang.reflect.InvocationTargetException原因:java.lang.AbstractMethodError:

ttygqcqt  于 2023-08-04  发布在  Spring
关注(0)|答案(2)|浏览(186)

尝试探索多篇文章相同,但没有帮助!
有人能解释一下这里可能出了什么问题吗?

"C:\Program Files (x86)\Java\jdk1.8.0_241\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.2\lib\idea_rt.jar=56127:C:\Program Files\JetBrains\IntelliJ IDEA 2020.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2020.2\lib\idea_rt.jar" com.intellij.rt.execution.CommandLineWrapper C:\Users\x01373661\AppData\Local\Temp\1\idea_classpath132405151 com.CONFIDENTIAL.svc.event.Application
Exception in thread "main" 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 com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:63)
Caused by: java.lang.AbstractMethodError: org.springframework.boot.context.config.ConfigFileApplicationListener.supportsSourceType(Ljava/lang/Class;)Z
    at org.springframework.context.event.GenericApplicationListenerAdapter.supportsSourceType(GenericApplicationListenerAdapter.java:79)
    at org.springframework.context.event.AbstractApplicationEventMulticaster.supportsEvent(AbstractApplicationEventMulticaster.java:289)
    at org.springframework.context.event.AbstractApplicationEventMulticaster.retrieveApplicationListeners(AbstractApplicationEventMulticaster.java:221)
    at org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:192)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
    at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:80)
    at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53)
    at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:345)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
    at com.barclaycardus.svc.event.Application.main(Application.java:66)
    ... 5 more

Process finished with exit code 1

字符串

huus2vyu

huus2vyu1#

您的类路径包含不兼容的依赖项。具体来说,您正在使用的Spring Framework的spring-context jar版本与Sping Boot 的spring-boot jar版本不兼容。使用Sping Boot 的依赖项管理并允许它控制应用程序依赖项的版本是避免此问题的推荐方法。

8ehkhllq

8ehkhllq2#

尝试删除目标文件夹,并重新构建应用程序在我的情况下,IDE设置Java 18,但我的应用程序使用Java 11我更改了它并删除了目标文件夹。

相关问题