Hi, I have a parent pom in my project that was using spring boot 1.5.9.RELEASE. I have upgraded this to 2.1.4.RELEASE. I am also using Spring version 5.1.6.RELEASE in this project. I am using the Spring batch framework, and spring-batch-core 4.2.3.RELEASE.
I am getting this error when attempting to run the main SpringBoot class:
Exception in thread "main" 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:75)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:340)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:304)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202)
at com.capitalone.coaf.marketing.offers.loader.Application.main(Application.java:57)
I am also using a dependency for my database classes, but I made sure to use the same spring boot and spring version in there. If anyone has any ideas I can try or needs me to post more information on what is in my POM, please let me know!
Comment From: wilkinsona
Since Spring Framework 5.1, supportsSourceType(Class<?> type)
became a default method on SmartApplicationListener
which ConfigFileApplicationListener
implements. As a result, the implementation of that method was removed from ConfigFileApplicationListener
in Spring Boot 2.1 as it was no longer needed. As an AbstractMethodError
is being thrown for that method, you must have Spring Framework 5.0 or earlier on the classpath somewhere. You can use mvn dependency:tree
to help you to determine why that's the case.
If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.
Comment From: alpizano
@wilkinsona Thank you for your response, I really appreciate it.
I am going through the dependencies right now but was slightly confused by your response - did you mean if I pull in ANY dependency that has a group of org.springframework with a version <= 5.0 this will happen? I have like 5000 million spring framework dependencies in my project and I was trying to resolve this issue but I still see the exception when I try running my main Spring boot class.
Comment From: snicoll
@alpizano as Andy indicated, if you have further questions please ask them on StackOverflow.