码迷,mamicode.com
首页 > 其他好文 > 详细

Active MQ 传输 ObjectMessage 异常

时间:2016-09-23 14:46:11      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

<bean id="targetConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">  
        <property name="brokerURL" value="tcp://localhost:61616"/>
        <!-- 如果传输的对象是Obeject 这里必须加上这句  否则会导致对象序列化失败 出现classnotfound异常  详细: http://activemq.apache.org/objectmessage.html -->
        <property name="trustAllPackages" value="true"/>
    </bean>  

在消费者接受队消息时,出现异常

javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: Forbidden class com.guesslive.admin.common.mail.Mail! 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.

然后根据提供的地址找了下原因,在 ActiveMQConnectionFactory 中加入参数 

<property name="trustAllPackages" value="true"/>

问题解决!

Active MQ 传输 ObjectMessage 异常

标签:

原文地址:http://www.cnblogs.com/xiaxinggege/p/5899611.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!