在基于Java的Web应用程序中尝试将Spring Boot升级到最新版本2.1.1和Spring Framework到5.1.3时,出现以下错误
Invalid bean definition with name 'org.springframework.transaction.config.internalTransactionalEventListenerFactory' defined in null
Run Code Online (Sandbox Code Playgroud)
完整的堆栈跟踪如下。关于进一步故障排除的任何想法都将有所帮助
Failure starting application: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'org.springframework.transaction.config.internalTransactionalEventListenerFactory' defined in null: Cannot register bean definition [Root bean: class [org.springframework.transaction.event.TransactionalEventListenerFactory]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'org.springframework.transaction.config.internalTransactionalEventListenerFactory': There is already [Root bean: class [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=transactionalEventListenerFactory; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.class]] bound.
at org.springframework.beans.factory.support.DefaultListableBeanFactory.registerBeanDefinition(DefaultListableBeanFactory.java:894)
at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.registerBeanDefinition(BeanDefinitionReaderUtils.java:166)
at org.springframework.beans.factory.xml.ParserContext.registerBeanComponent(ParserContext.java:125)
at …Run Code Online (Sandbox Code Playgroud)