赞
踩
使用activeMq报错:
Caused by: org.springframework.jms.support.converter.MessageConversionException: Could not convert JMS message; nested exception is javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: Forbidden class java.util.ArrayList! This class is not trusted to be serialized as ObjectMessage payload. Please take a look at http://activemq.apache.org/objectmessage.html for more information on how to configure trusted classes.
在application.properties文件中添加spring.activemq.packages.trust-all=true可以解决这个报错
在application.yml中:
server:
port: 80
spring:
activemq:
broker-url: tcp://localhost:61616
user: admin
password: admin
pool:
enabled: true
#连接池最大连接数
max-connections: 5
#空闲的连接过期时间,默认为30秒
idle-timeout: 0
packages:
trust-all: true
jms:
pub-sub-domain: true
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。