org.springframework.jms.config.DefaultJmsListenerContainerFactory.setExceptionListener

一、jar包版本


pom.xml
        <springboot.version>2.6.2</springboot.version>
        <spring.version>5.3.14</spring.version>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-all</artifactId>
            <version>5.16.5</version>
        </dependency>

二、控制台启动报错信息

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer.configure(DefaultJmsListenerContainerFactoryConfigurer.java:117)

The following method did not exist:

    org.springframework.jms.config.DefaultJmsListenerContainerFactory.setExceptionListener(Ljavax/jms/ExceptionListener;)V

The calling method's class, org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer, was loaded from the following location:

    jar:file:/D:/developsoft/java/javaweb/commonBackPlugins/maven/apache-maven-3.8.1/maven_localM2_IdeaPro/org/springframework/boot/spring-boot-autoconfigure/2.6.2/spring-boot-autoconfigure-2.6.2.jar!/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.class

The called method's class, org.springframework.jms.config.DefaultJmsListenerContainerFactory, is available from the following locations:

    jar:file:/D:/developsoft/java/javaweb/commonBackPlugins/maven/apache-maven-3.8.1/maven_localM2_IdeaPro/org/apache/activemq/activemq-all/5.16.5/activemq-all-5.16.5.jar!/org/springframework/jms/config/DefaultJmsListenerContainerFactory.class

The called method's class hierarchy was loaded from the following locations:

    org.springframework.jms.config.DefaultJmsListenerContainerFactory: file:/D:/developsoft/java/javaweb/commonBackPlugins/maven/apache-maven-3.8.1/maven_localM2_IdeaPro/org/apache/activemq/activemq-all/5.16.5/activemq-all-5.16.5.jar
    org.springframework.jms.config.AbstractJmsListenerContainerFactory: file:/D:/developsoft/java/javaweb/commonBackPlugins/maven/apache-maven-3.8.1/maven_localM2_IdeaPro/org/apache/activemq/activemq-all/5.16.5/activemq-all-5.16.5.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer and org.springframework.jms.config.DefaultJmsListenerContainerFactory


依赖冲突了吧