spring boot 整合 RabbitMQ 錯誤


1.錯誤

org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'org.springframework.amqp.rabbit.config.internalRabbitListenerAnnotationProcessor' 
defined in class path resource [org/springframework/amqp/rabbit/annotation/RabbitBootstrapConfiguration.class]:
 Bean instantiation via factory method failed; 
 nested exception is org.springframework.beans.BeanInstantiationException: F
 ailed to instantiate [org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor]: 
 Factory method 'rabbitListenerAnnotationProcessor' threw exception;
 nested exception is java.lang.NoClassDefFoundError: org/springframework/messaging/handler/annotation/support/MessageHandlerMethodFactory

一大堆,不過最關鍵的是

java.lang.NoClassDefFoundError: org/springframework/messaging/handler/annotation/support/MessageHandlerMethodFactory

這個類沒有找見

2.解決:

這個類是通過 spring boot 的web 模塊導入的

所以直接在 gradle中  添加

implementation 'org.springframework.boot:spring-boot-starter-web'

即可

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM