问题排查之'org.apache.rocketmq.spring.starter.core.RocketMQTemplate' that could not be found.- Bean method 'rocketMQTemplate' in 'RocketMQAutoConfiguration' not loaded.
背景
今天将一个SpringBoot项目的配置参数从原有的.yml文件迁移到Apollo后,启动报错“Bean method 'rocketMQTemplate' in 'RocketMQAutoConfiguration' not loaded because @ConditionalOnBean (types: org.apache.rocketmq.client.producer.DefaultMQProducer; SearchStrategy: all) did not find any beans of type org.apache.rocketmq.client.producer.DefaultMQProducer”。花了两个小时才最终搞清楚,原因是缺少了配置项 spring.rocketmq.producer.group 从而导致无法成功创建RocketMQAutoConfiguration这个Bean,从而导致一连串对此有依赖的Bean无法创建成功。
排查过程
启动的错误日志
2019-04-02 15:21:33.689 WARN 17516 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myServiceAImpl': Unsatisfied dependency expressed through field 'myServiceBImpl'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myServiceAImpl': Unsatisfied dependency expressed through field 'rocketMQTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.rocketmq.spring.starter.core.RocketMQTemplate' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2019-04-02 15:21:33.692 INFO 17516 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed
2019-04-02 15:21:33.693 INFO 17516 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService
2019-04-02 15:21:33.693 INFO 17516 --- [ main] f.a.ReferenceAnnotationBeanPostProcessor : class com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!
2019-04-02 15:21:33.702 INFO 17516 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-04-02 15:21:33.842 ERROR 17516 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field rocketMQTemplate in net.yourpackage.myServiceBImpl required a bean of type 'org.apache.rocketmq.spring.starter.core.RocketMQTemplate' that could not be found.
- Bean method 'rocketMQTemplate' in 'RocketMQAutoConfiguration' not loaded because @ConditionalOnBean (types: org.apache.rocketmq.client.producer.DefaultMQProducer; SearchStrategy: all) did not find any beans of type org.apache.rocketmq.client.producer.DefaultMQProducer
Action:
Consider revisiting the conditions above or defining a bean of type 'org.apache.rocketmq.spring.starter.core.RocketMQTemplate' in your configuration.
问题原因

- spring.rocketmq.nameServer
- spring.rocketmq.producer.group
问题排查之'org.apache.rocketmq.spring.starter.core.RocketMQTemplate' that could not be found.- Bean method 'rocketMQTemplate' in 'RocketMQAutoConfiguration' not loaded.的更多相关文章
- 【报错】spring整合activeMQ,pom.xml文件缺架包,启动报错:Caused by: java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v2.XBeanNamespaceHandler
spring版本:4.3.13 ActiveMq版本:5.15 ======================================================== spring整合act ...
- Apache RocketMQ 消息队列部署与可视化界面安装
一.介绍 Apache RocketMQ是一个分布式.队列模型的消息中间件,具有低延迟.高性能和高可靠.万亿级容量和灵活的可扩展性.核心组件由四部分组成:Name Servers,Brokers,Pr ...
- 【Apache RocketMQ】RocketMQ捐赠给Apache那些鲜为人知的故事-转自阿里中间件
序言 今年的双十一对阿里巴巴中间件消息团队来说,注定是个不平凡的日子.在这一天,稳定性小组重点攻克的低延迟存储解决方案成功地经受住了大考.整个大促期间,99.996%的延迟落在了10ms以内,极个别由 ...
- Apache RocketMQ在linux上的常用命令
Apache RocketMQ在linux上的常用命令 进入maven安装后的rocketmq的bin目录 1.启动Name Server 2.启动Broker 3.关闭Name Server 4 ...
- 【shiro】报错:Caused by: java.lang.ClassNotFoundException: org.apache.shiro.spring.LifecycleBeanPostProcessor
Caused by: java.lang.ClassNotFoundException: org.apache.shiro.spring.LifecycleBeanPostProcessor at o ...
- Apache RocketMQ 正式开源分布式事务消息
近日,Apache RocketMQ 社区正式发布4.3版本.此次发布不仅包括提升性能,减少内存使用等原有特性增强,还修复了部分社区提出的若干问题,更重要的是该版本开源了社区最为关心的分布式事务消息, ...
- Apache RocketMQ 的过去、现在和未来 原创: DataPipeline DataPipeline数见科技 前天
Apache RocketMQ 的过去.现在和未来 原创: DataPipeline DataPipeline数见科技 前天
- Apache Camel,Spring Boot 实现文件复制,转移 (转)
基本框架 Apache Camel Spring Boot Maven 开发过程 1.新建一个POM(quickstart)项目,在POM文件中添加Camel和Spring Boot的依赖 <p ...
- org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout 和 RocketmqRemoting closeChannel: close the connection to remote address[] result: true
org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout ...
随机推荐
- Centos 创建 docker项目
从gitlab上下载一个docker-compose.yml文件. wget -o docker-compose.yml \ https://raw.githubusercontent.com/sam ...
- ios三张图片组合一张
- (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 { UIGraphicsBeginImageContext(imag ...
- Sql Server 统计当天数据
方法一. ),日期字段名,)),) 方法二. Access: * FROM 表名 WHERE DAY(日期字段名)=DAY(NOW()) 查询当天之前一天的数据
- C++ Error: no appropriate default constructor available
我定义了一个结构体,然后初始化它,结果编译报错 no appropriate default constructor available 代码如下: struct matrixXvect_func { ...
- gnuplot生成gif动画
最近有个任务需要生成一个动态变化的图,然后突然发现gnuplot竟然可以生成gif动画,当真是应正了博客Gnuplot surprising的子标题: I always tell myself: &q ...
- [分布式系统学习]阅读笔记 Distributed systems for fun and profit 抽象 之二
本文是阅读 http://book.mixu.net/distsys/abstractions.html 的笔记. 第二章的题目是"Up and down the level of abst ...
- 计蒜客 30999 - Sum - [找规律+线性筛][2018ICPC南京网络预赛J题]
题目链接:https://nanti.jisuanke.com/t/30999 样例输入258 样例输出814 题意: squarefree数是指不含有完全平方数( 1 除外)因子的数, 现在一个数字 ...
- Spring的AOP编程
1.手动实现AOP编程(代理模式) AOP是面向切面的编程,主要功能就是实现"业务代码"和辅助业务代码的"关注点代码"分离.在一个方法中,出了核心的业务代码,其 ...
- Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2)
A. Search for Pretty Integers 题目链接:http://codeforces.com/contest/872/problem/A 题目意思:题目很简单,找到一个数,组成这个 ...
- Cloud Native Application理论备忘录之(一)——Microservice architectural style
感谢一路走来默默支持和陪伴的你~~~ ------------------欢迎来访,拒绝转载------------------- 1. 传统云平台的架构体系:用户界面层.业务逻辑层.数据访问层 2. ...