required a bean of type 'org.springframework.jms.core.JmsMessagingTemplate' that could not be found

问题来源
  Spring Boot 项目集成 ActiveMQ。
报错内容
  Description:Field jmsTemplate in XXX required a bean of type 'org.springframework.jms.core.JmsMessagingTemplate' that could not be found.
原因分析
  在配置文件中配置ActiveMQ的时候,某些项,例如spring.activemq.pool.enabled,的值末尾有空格,导致系统读取配置文件信息的时候,读取到了追加了空格的值,而非我们预期的值:
spring.activemq.broker-url=tcp://localhost:61616
spring.activemq.in-memory=true空格
spring.activemq.pool.enabled=false空格

  备注:true和false后面被无意中加上了空格。

posted @ 2020-06-15 20:16  楼兰胡杨  阅读(1459)  评论(0编辑  收藏  举报