当前位置:   article > 正文

Caused by: org.springframework.jms.support.converter.MessageConversionException: Could not convert J_caused by: org.springframework.amqp.support.conver

caused by: org.springframework.amqp.support.converter.messageconversionexcep

使用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

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/256980
推荐阅读
相关标签
  

闽ICP备14008679号