org.springframework.aop.config.internalAutoProxyCreator': BeanPostProcessor - nested exception is j



Tomcat在部署Spring应用程序时抛出以下错误

2022-10-04 09:23:34.427 INFO  [factory.annotation.AutowiredAnnotationBeanPostProcessor] - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2022-10-04 09:23:34.584 WARN  [context.support.XmlWebApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.config.internalAutoProxyCreator': BeanPostProcessor before instantiation of bean failed; nested exception is java.lang.AbstractMethodError
2022-10-04 09:23:34.586 ERROR [web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.config.internalAutoProxyCreator': BeanPostProcessor before instantiation of bean failed; nested exception is java.lang.AbstractMethodError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:477)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:225)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:703)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:527)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5197)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5720)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1705)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1695)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.AbstractMethodError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1041)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1015)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:471)
... 19 more

渐变依赖树看起来像

runtimeClasspath - Runtime classpath of source set 'main'.
+--- org.springframework.security:spring-security-config:5.7.3
|    +--- org.springframework.security:spring-security-core:5.7.3
|    |    +--- org.springframework.security:spring-security-crypto:5.7.3
|    |    +--- org.springframework:spring-`aop`:5.3.22 -> 5.3.23
|    |    |    +--- org.springframework:spring-beans:5.3.23
|    |    |    |    --- org.springframework:spring-core:5.3.23
|    |    |    |         --- org.springframework:spring-jcl:5.3.23
|    |    |    --- org.springframework:spring-core:5.3.23 (*)
|    |    +--- org.springframework:spring-beans:5.3.22 -> 5.3.23 (*)
|    |    +--- org.springframework:spring-context:5.3.22 -> 5.3.23
|    |    |    +--- org.springframework:spring-aop:5.3.23 (*)
|    |    |    +--- org.springframework:spring-beans:5.3.23 (*)
|    |    |    +--- org.springframework:spring-core:5.3.23 (*)
|    |    |    --- org.springframework:spring-expression:5.3.23
|    |    |         --- org.springframework:spring-core:5.3.23 (*)
|    |    +--- org.springframework:spring-core:5.3.22 -> 5.3.23 (*)
|    |    --- org.springframework:spring-expression:5.3.22 -> 5.3.23 (*)
|    +--- org.springframework:spring-aop:5.3.22 -> 5.3.23 (*)
|    +--- org.springframework:spring-beans:5.3.22 -> 5.3.23 (*)
|    +--- org.springframework:spring-context:5.3.22 -> 5.3.23 (*)
|    --- org.springframework:spring-core:5.3.22 -> 5.3.23 (*)
+--- org.springframework:spring-orm:5.3.23
|    +--- org.springframework:spring-beans:5.3.23 (*)
|    +--- org.springframework:spring-core:5.3.23 (*)
|    +--- org.springframework:spring-jdbc:5.3.23
|    |    +--- org.springframework:spring-beans:5.3.23 (*)
|    |    +--- org.springframework:spring-core:5.3.23 (*)
|    |    --- org.springframework:spring-tx:5.3.23
|    |         +--- org.springframework:spring-beans:5.3.23 (*)
|    |         --- org.springframework:spring-core:5.3.23 (*)
|    --- org.springframework:spring-tx:5.3.23 (*)
+--- org.springframework:spring-web:5.3.23
|    +--- org.springframework:spring-beans:5.3.23 (*)
|    --- org.springframework:spring-core:5.3.23 (*)
+--- javax.inject:javax.inject:1
+--- com.fasterxml.jackson.core:jackson-core:2.2.0 -> 2.13.2 (*)
+--- com.fasterxml.jackson.core:jackson-databind:2.2.0 -> 2.13.2.2 (*)
+--- org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1
+--- com.javadocmd:simplelatlng:1.0.1
+--- xerces:xercesImpl:2.11.0
|    --- xml-apis:xml-apis:1.4.01
+--- org.drools:drools-compiler:5.3.0.Final
|    +--- org.drools:drools-core:5.3.0.Final
|    |    +--- org.mvel:mvel2:2.1.0.drools4
|    |    --- org.drools:knowledge-api:5.3.0.Final
|    +--- org.antlr:antlr-runtime:3.3
|    |    --- org.antlr:stringtemplate:3.2.1
|    |         --- antlr:antlr:2.7.7
|    +--- org.antlr:antlr:3.3
|    |    --- org.antlr:antlr-runtime:3.3 (*)
|    +--- org.antlr:stringtemplate:3.2.1 (*)
|    +--- antlr:antlr:2.7.7
|    +--- org.eclipse.jdt.core.compiler:ecj:3.5.1
|    --- org.mvel:mvel2:2.1.0.drools4
+--- com.trilead:trilead-ssh2:1.0.0-build222
+--- javax.servlet:javax.servlet-api:3.0.1
+--- org.springframework:spring-beans:5.3.23 (c)
+--- org.springframework:spring-context:5.3.23 (c)
+--- org.springframework:spring-core:5.3.23 (c)
--- org.springframework:spring-expression:5.3.23 (c)

我有来自其他jar的可传递依赖项compileOnly'org.aspectj:aspectjweaver:1.9.2'compileOnly"org.aspectj:aspectjrt:1.8.0">

我已经删除了aop依赖关系的所有可传递性,但仍然面临同样的问题。我看了一下类方法的实现就在那里。不知何故,它没有意识到它,或者可能指向其他版本。

谢谢你直接给我指对了。

发现我的问题,原因是我的项目中有activemq-all依赖项,该项目附带了旧版本的spring。这个spring依赖项没有显示在依赖树中,因为它包含在同一个activemq-all-jar中。

相关内容

最新更新