Spring Boot 2.1.0应用启动报AbstractMethodError错误求助
Hey there, let's tackle this AbstractMethodError you're facing. This error almost always points to a dependency version conflict—specifically, a situation where your code is compiled against one version of an interface/abstract class, but at runtime, it's picking up an older implementation that doesn't have the required method.
Let's break down the issue and fix it step by step:
1. Understand the root cause
The error occurs in AbstractApplicationEventMulticaster.supportsEvent(), which means somewhere in your dependencies, an older version of Spring Context (or a related Spring module) is being pulled in, conflicting with the Spring Boot 2.1.0.RELEASE version you're using.
2. Identify conflicting dependencies
First, run this Maven command to generate a dependency tree and spot the culprits:
mvn dependency:tree -Dverbose
Look for any entries with groupId: org.springframework that have a version lower than 2.1.0.RELEASE—these are the conflicting ones. From your pom.xml, a few suspects stand out:
- Apache JMeter dependencies: Versions 2.8, 2.7, and 3.3 are quite old and likely depend on outdated Spring libraries.
- Spring Retry: You've excluded
spring-core, but specifying a manual version (1.2.4.RELEASE) might not align perfectly with Spring Boot's managed versions. - Legacy libraries: Old tools like XStream 1.3 could also introduce hidden conflicts.
3. Fix the conflicts
Here's what you can adjust in your pom.xml:
Clean up JMeter dependencies: Add exclusions for all Spring-related modules in every JMeter dependency to prevent them from pulling in old Spring versions. For example:
<dependency> <groupId>org.apache.jmeter</groupId> <artifactId>ApacheJMeter_core</artifactId> <version>2.8</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency>Do this for all
ApacheJMeter_*andjorphandependencies.Use Spring Boot's managed version for Spring Retry: Remove the manual
versiontag from yourspring-retrydependency, and let the Spring Boot parent handle it. Also, you can remove the exclusion forspring-coresince the parent will ensure the correct version is used:<dependency> <groupId>org.springframework.retry</groupId> <artifactId>spring-retry</artifactId> </dependency>Verify Swagger compatibility: Swagger 1.5.x should work with Spring Boot 2.1, but double-check its dependencies via the tree command—exclude any conflicting Spring modules if found.
4. Rebuild and test
After making these changes:
- Clean your Maven project and refresh dependencies:
mvn clean install -U - In Eclipse, right-click your project → Maven → Update Project, and check "Force Update of Snapshots/Releases" to ensure all dependencies are pulled correctly.
- Run your Spring Boot app again.
Extra tips to avoid future issues
- Stick to Spring Boot starter dependencies whenever possible—they're designed to handle version compatibility automatically.
- Avoid manually specifying versions for Spring-related libraries; let the
spring-boot-starter-parentmanage them. - Consider upgrading older non-Spring dependencies (like JMeter) to versions that are compatible with Spring Boot 2.1, if feasible.
内容的提问来源于stack exchange,提问作者Parthiban

