Harsh
Harsh

Reputation: 962

Exception in thread "main" java.lang.reflect.InvocationTargetException Caused by: java.lang.AbstractMethodError:

Tried exploring multiple articles for the same but didn't help !

Can someone throw some light what could be possibly wrong here ?

"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

Upvotes: 1

Views: 3391

Answers (2)

Eufránio Diogo
Eufránio Diogo

Reputation: 67

Try to delete target folder, and build again the application in my case, the IDE set Java 18, but my application uses Java 11 I changed it and deleted the target folder.

Upvotes: 1

Andy Wilkinson
Andy Wilkinson

Reputation: 116091

Your classpath contains incompatible dependencies. Specifically, the version of Spring Framework's spring-context jar that you are using is not compatible with the version of Spring Boot's spring-boot jar. Using Spring Boot's dependency management and allowing it to control the versions of your application's dependencies is the recommended way to avoid this problem.

Upvotes: 1

Related Questions