2017-03-08 34 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開始工作 –

相關問題