2017-03-08 77 views
0

这是我添加到我的spring项目中的代码,它在尝试使用tomcat运行时没有入门。当spring-rabbit依赖项添加到pom.xml中时mvn给出了异常

<dependency> 
    <groupId>org.springframework.amqp</groupId> 
    <artifactId>spring-amqp</artifactId> 
    <version>1.7.0.RELEASE</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework.amqp</groupId> 
    <artifactId>spring-rabbit</artifactId> 
    <version>1.7.0.RELEASE</version> 
</dependency> 
+1

什么异常? – duffymo

+0

这是运行mvn tomcat时生成的第一个异常:嵌套异常是java.lang.NoClassDefFoundError:org/springframework/context/event/EventListenerFactory –

+0

找到该JAR并添加该依赖关系。继续下去,直到所有例外消失。 – duffymo

回答

1
Instead of two dependencies add only one dependency as follows. 

<dependency> 
    <groupId>org.springframework.integration</groupId> 
    <artifactId>spring-integration-amqp</artifactId> 
    <version>4.3.5.RELEASE</version> 
</dependency> 
+0

添加此代码后,我的rabbitmq开始工作 –

相关问题