You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Andrè <mo...@web.de> on 2011/07/06 13:23:34 UTC

Failed to build body from content. Serializable class not available to broker

i get this exception at broker A, where it shouldn´t appear in my opinition
the ClassNotFoundException is result of receiving the ContextRequestType
which sounds clear, but why do i receive it ?? because the class is the 
result of the unmarshalling , so it shouldnt be directed to the wire , right
? 
Why is it distributed ? 
(sry but it may be an active mq issue)
Broker A
		<route>
			<from uri="direct:injectRequest" />
			<to uri="bean:isAuthZBlocked?method=checkRequest" />
			<doTry>
				<to
uri="activemq:topic:services.global.xacml.authzRequests?transferException=true"
/>
				<doCatch>
				
					<exception>org.apache.camel.RuntimeCamelException
					</exception>
					<process ref="ExceptionDeWrapper" />
				</doCatch>
			</doTry>
		</route>

Broker B (not the subscriber, which really responds to payload send from A,
just evaluates it)
   <route id="DroolsIncomingroute">
        <from uri="activemq:topic:services.global.>"/>
        <policy ref="droolsPolicy">
            <unmarshal ref="Xacml20jaxb"/>
            <to uri="drools:node1/ksession1?action=insertBody"/>
        </policy>
    </route>

org.apache.camel.RuntimeCamelException: Failed to extract body due to:
javax.jms.JMSException: Failed to build body from content. Serializable
class not available to broker. Reason: java.lang.ClassNotFoundException:
de.tarent.abiege.jaxb.generated.xacml.context.ContextRequestType. Message:
ActiveMQObjectMessage {commandId = 15, responseRequired = false, messageId =
ID:abiege.bonn.tarent.de-43271-1309947486470-2:1:1:1:32, originalDestination
= null, originalTransactionId = null, producerId =
ID:abiege.bonn.tarent.de-43271-1309947486470-75:1:1:1, destination =
temp-queue://ID:abiege.bonn.tarent.de-40803-1309949900778-4:7:1,
transactionId = null, expiration = 0, timestamp = 1309949908328, arrival =
0, brokerInTime = 1309949908338, brokerOutTime = 1309949908338,
correlationId = ID-abiege-bonn-tarent-de-40190-1309949900228-2-4, replyTo =
temp-queue://ID:abiege.bonn.tarent.de-40803-1309949900778-4:7:1, persistent
= true, type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@f690e4, marshalledProperties =
org.apache.activemq.util.ByteSequence@1a29450, dataStructure = null,
redeliveryCounter = 0, size = 3096, properties = {CamelJmsDeliveryMode=2},
readOnlyProperties = true, readOnlyBody = true, droppable = false}
        at
org.apache.camel.component.jms.JmsBinding.extractBodyFromJms(JmsBinding.java:159)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
        at
org.apache.camel.component.jms.JmsMessage.createBody(JmsMessage.java:183)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
        at
org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
        at
org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:124)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
        at
org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onReply(TemporaryQueueReplyHandler.java:52)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
        at
org.apache.camel.component.jms.reply.TemporaryQueueReplyManager.handleReplyMessage(TemporaryQueueReplyManager.java:66)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
        at
org.apache.camel.component.jms.reply.ReplyManagerSupport.onMessage(ReplyManagerSupport.java:110)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
        at java.lang.Thread.run(Thread.java:636)[:1.6.0_18]

--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-build-body-from-content-Serializable-class-not-available-to-broker-tp4556486p4556486.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Failed to build body from content. Serializable class not available to broker

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jul 7, 2011 at 11:44 AM, Andrè <mo...@web.de> wrote:
> yes, i do or shouldnt i do that ??
>
> (context:i´m trying to use the topic as a many/many thing..., where
> producers send and one consumer responds and a other just listens, which
> should as close as possible to JMS (thats why i dont use a wiretap))
>

You can disable camel-jms to map the received message.

You can add this option to the uri in broker A
mapJmsMessage=false

You can read about this option at
http://camel.apache.org/jms

But you will still have the problem that broker B send back a reply as
a Java Object, and that Java Object class is not on the classpath on
broker A. So you would need to copy the JAR  that has those classes to
broker A as well.


> --
> View this message in context: http://camel.465427.n5.nabble.com/Failed-to-build-body-from-content-Serializable-class-not-available-to-broker-tp4556486p4560507.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Failed to build body from content. Serializable class not available to broker

Posted by Andrè <mo...@web.de>.
yes, i do or shouldnt i do that ??

(context:i´m trying to use the topic as a many/many thing..., where
producers send and one consumer responds and a other just listens, which
should as close as possible to JMS (thats why i dont use a wiretap))

--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-build-body-from-content-Serializable-class-not-available-to-broker-tp4556486p4560507.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Failed to build body from content. Serializable class not available to broker

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jul 7, 2011 at 10:15 AM, Andrè <mo...@web.de> wrote:
> thx, claus
> but thats not the point, ... why is it on the wire ? , it´s the product of
> an unmarshalling and directly inserted in an drools endpoints (see route),
> so it shouldnt be there, am i right ?
>

You get the exception on broker A when you do this part of the route
                               <to
uri="activemq:topic:services.global.xacml.authzRequests?transferException=true"

It seems you do a InOut over a JMS topic. Do you intend to do that?
http://camel.apache.org/request-reply.html

> --
> View this message in context: http://camel.465427.n5.nabble.com/Failed-to-build-body-from-content-Serializable-class-not-available-to-broker-tp4556486p4560293.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Failed to build body from content. Serializable class not available to broker

Posted by Andrè <mo...@web.de>.
thx, claus
but thats not the point, ... why is it on the wire ? , it´s the product of
an unmarshalling and directly inserted in an drools endpoints (see route),
so it shouldnt be there, am i right ? 

--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-build-body-from-content-Serializable-class-not-available-to-broker-tp4556486p4560293.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Failed to build body from content. Serializable class not available to broker

Posted by Claus Ibsen <cl...@gmail.com>.
If you send java objects over JMS then make sure the .class files is
on both brokers. And that the java object properly supports
serialization.

If you instead want to send a javax.jms.TextMessage, then you can
force Camel to use that using the option
jmsMessageType=Text

   <to uri="bean:isAuthZBlocked?method=checkRequest&jmsMessageType=Text" />



On Wed, Jul 6, 2011 at 1:23 PM, Andrè <mo...@web.de> wrote:
> i get this exception at broker A, where it shouldn´t appear in my opinition
> the ClassNotFoundException is result of receiving the ContextRequestType
> which sounds clear, but why do i receive it ?? because the class is the
> result of the unmarshalling , so it shouldnt be directed to the wire , right
> ?
> Why is it distributed ?
> (sry but it may be an active mq issue)
> Broker A
>                <route>
>                        <from uri="direct:injectRequest" />
>                        <to uri="bean:isAuthZBlocked?method=checkRequest" />
>                        <doTry>
>                                <to
> uri="activemq:topic:services.global.xacml.authzRequests?transferException=true"
> />
>                                <doCatch>
>
>                                        <exception>org.apache.camel.RuntimeCamelException
>                                        </exception>
>                                        <process ref="ExceptionDeWrapper" />
>                                </doCatch>
>                        </doTry>
>                </route>
>
> Broker B (not the subscriber, which really responds to payload send from A,
> just evaluates it)
>   <route id="DroolsIncomingroute">
>        <from uri="activemq:topic:services.global.>"/>
>        <policy ref="droolsPolicy">
>            <unmarshal ref="Xacml20jaxb"/>
>            <to uri="drools:node1/ksession1?action=insertBody"/>
>        </policy>
>    </route>
>
> org.apache.camel.RuntimeCamelException: Failed to extract body due to:
> javax.jms.JMSException: Failed to build body from content. Serializable
> class not available to broker. Reason: java.lang.ClassNotFoundException:
> de.tarent.abiege.jaxb.generated.xacml.context.ContextRequestType. Message:
> ActiveMQObjectMessage {commandId = 15, responseRequired = false, messageId =
> ID:abiege.bonn.tarent.de-43271-1309947486470-2:1:1:1:32, originalDestination
> = null, originalTransactionId = null, producerId =
> ID:abiege.bonn.tarent.de-43271-1309947486470-75:1:1:1, destination =
> temp-queue://ID:abiege.bonn.tarent.de-40803-1309949900778-4:7:1,
> transactionId = null, expiration = 0, timestamp = 1309949908328, arrival =
> 0, brokerInTime = 1309949908338, brokerOutTime = 1309949908338,
> correlationId = ID-abiege-bonn-tarent-de-40190-1309949900228-2-4, replyTo =
> temp-queue://ID:abiege.bonn.tarent.de-40803-1309949900778-4:7:1, persistent
> = true, type = null, priority = 4, groupID = null, groupSequence = 0,
> targetConsumerId = null, compressed = false, userID = null, content =
> org.apache.activemq.util.ByteSequence@f690e4, marshalledProperties =
> org.apache.activemq.util.ByteSequence@1a29450, dataStructure = null,
> redeliveryCounter = 0, size = 3096, properties = {CamelJmsDeliveryMode=2},
> readOnlyProperties = true, readOnlyBody = true, droppable = false}
>        at
> org.apache.camel.component.jms.JmsBinding.extractBodyFromJms(JmsBinding.java:159)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
>        at
> org.apache.camel.component.jms.JmsMessage.createBody(JmsMessage.java:183)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
>        at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
>        at
> org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:124)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
>        at
> org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onReply(TemporaryQueueReplyHandler.java:52)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
>        at
> org.apache.camel.component.jms.reply.TemporaryQueueReplyManager.handleReplyMessage(TemporaryQueueReplyManager.java:66)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
>        at
> org.apache.camel.component.jms.reply.ReplyManagerSupport.onMessage(ReplyManagerSupport.java:110)[camel-jms-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
>        at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
>        at
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
>        at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
>        at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
>        at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
>        at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
>        at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
>        at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)[spring-jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
>        at java.lang.Thread.run(Thread.java:636)[:1.6.0_18]
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Failed-to-build-body-from-content-Serializable-class-not-available-to-broker-tp4556486p4556486.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/