开发者社区> 问答> 正文

SpringCloud项目集成阿里云nacos配置管理后 启动报错

SpringBoot项目改SpringCloud项目,没集成alibaba nacos时运行无异常,集成了之后启动报错,提示找不到相关bean,但是功能却是正常的。 云配置文件是加载到了的 image.png image.png image.png 报错内容:

2019-11-14 15:31:28  [ com.alibaba.nacos.client.Worker.longPullingacm.aliyun.com-32f1587d-47d1-4060-bf86-870b0d47c500:17212 ] - [ WARN ] org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:558) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'invoiceCallbackApiController': Unsatisfied dependency expressed through field 'invoiceCallbackProducer'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'yongYouInvoiceCallbackProducer': Unsatisfied dependency expressed through field 'amqpTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.amqp.core.AmqpTemplate' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2019-11-14 15:31:28  [ com.alibaba.nacos.client.Worker.longPullingacm.aliyun.com-32f1587d-47d1-4060-bf86-870b0d47c500:17220 ] - [ ERROR ] org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter.report(LoggingFailureAnalysisReporter.java:42) 

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

Description:

Field amqpTemplate in cn.xxx.invoice.service.rabbitmq.producer.YongYouInvoiceCallbackProducer required a bean of type 'org.springframework.amqp.core.AmqpTemplate' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.amqp.core.AmqpTemplate' in your configuration.

遇到了同样的问题,在CSDN看到了,希望阿里云团队能够给出正确、标准的答案~请查看

展开
收起
刘刚_ 2020-05-23 15:50:25 2315 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
搭建基于SpringCloud的微服务应用 立即下载
workshop专场-微服务专场-开发者动手实践营-微服务-使用Nacos进行服务的动态发现和流量调度 立即下载
Nacos 启航,发布第一个版本, 云原生时代助力用户微服务平台建设 立即下载