JMS
1.Field jmsMessagingTemplate in sample.activemq.provider.Provider required a bean of type 'org.springframework.jms.core.JmsMessagingTemplate' that could not be found.- Bean method 'jmsMessagingTemplate' not loaded because Ancestor org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration did not match
spring.activemq.broker-url=tcp://192.168.0.20:61616
spring.activemq.in-memory=true空格
spring.activemq.pool.enabled=false空格
配置文件中配置项spring.activemq.pool.enabled配置的值中有空格 导致实际的值设置没有成功
spring.activemq.pool.enabled的配置认值是true, 当设置为true时是要提供 pool factory(
activemq-pool的依赖包)的 其它配置项目中有空格也会导致
jmsMessagingTemplate初始化问题
如果要使用pool(
spring.activemq.pool.enabled=true
) 添加依赖
gradle:
maven:
参考:
引用文字(It is my mistake, I set spring.activemq.pool.enabled=true. and i dont set PooledConnectionFactory.)
http://412887952-qq-com.iteye.com/blog/2319751
查看评论中 讨论空格问题的
Gradle SpringBoot构建插件
1.SpringBoot project gradle build 'bootRepackage' task fails because it is unable to rename jar
如:
* What went wrong:
Execution failed for task ':moerqp-Shared:bootRepackage'.
> Unable to rename 'G:\Repositories\moer\trunk\moerqp-Shared\build\libs\moerqp-Shared-0.0.1-SNAPSHOT.jar' to 'G:\Repositories\moer\trunk\moerqp-Shared\build\libs\moerqp-Shared-0.0.1-SNAPSHOT.jar.original'
因为引入spring-boot构建插件如:
buildscript {
ext {
springBootVersion = '1.5.7.RELEASE'
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
这个插件有一个bootRepackage任务,它的作用是重新打包jar为可执行的jar
bootRepackage - Repackage existing JAR and WAR archives so that they can be executed from the command line using 'java -jar'
所以他需要指定一个MainClass, 解决办法
关掉bootRepackage任务
bootRepackage.enabled =
false
或
配置mainclass
bootRepackage { mainClass =
'youPackage.Application'
}