You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by contactreji <co...@gmail.com> on 2013/09/11 14:27:55 UTC

CFX to Queue : io.serializationException

Hi Guys

I have a problem in the following route.

*<route id="Route1_MES_Queue">
			<from uri="cxf:bean:PowerConsumptionEndpoint"/>
			<log message="Persisting Message to queue ${body}\n">
				<description>&lt;bean ref="myBean"/&gt;</description>
			</log>
			<to uri="activemq:queue:EC_InboundQueue" />
		</route>
*

The data from cxf:bean:PowerConsumptionEndpoint is not able to queue up  in
the message broker. It gives io.serialization exception.

I tried modifying as cxf:bean:PowerConsumptionEndpoint?dataFormat=MESSAGE
which indeed solved the issue.

But I have another route picking the same data from the queue as 

*
<route id="Route2_Queue_SAPPI">
			<from uri="activemq:queue:EC_InboundQueue" />

			<log message="Message dequed Queue ${body}\n">
				<description>&lt;bean ref="myBean"/&gt;</description>
			</log>
			<to uri="SAPClientInvoker" />
		</route>*

Here the SAPClientInvoker is a Java class which makes a webservice call to
SAP PI system. We have followed the WSDL approach and we have a schema class
DTPowerConsumption whose object is used to invoke Webservice call to SAP PI.
*
This is part of SAPClientInvoker Class
DTPowerConsumption PC=exchng.getIn().getBody(DTPowerConsumption.class);
		LOGGER.info("\n Data received for Energy Consumption from MES  \n");
		LOGGER.info("\n Sending Request from MES to PI for Energy Consumption
\n");
		
		try {
			LOGGER.info("before invoking");
			sapService.siID59PowerconsumptionAsyncOut(PC);
			LOGGER.info("Response from PI for Energy Consumption");
			exchng.getOut().setBody("Response from PI Energy for consumption");

*
Now i assume that dataFormat=MESSAGE parameter is fiddling with the original
compatible data coming to fuse endpoint and hencethe SAPClientInvoker
webservice call is not able to maintain the perfect call to SAP PI. and SAP
PI ends up sending HTTP 500 error code .


Can anyone suggest me how to store the data on route 1 without really
fiddling with the message formats without serialization exceptions?

Or can I use a marshaller before storing it into the Queue and unmarshaller
after fetching it from the queue before calling SAPClinetInvoker?

If so can I use Camel component 

*<marshal>
            <jaxb prettyPrint="false" contextPath="org.apache.camel.example"
                partClass="org.apache.camel.example.PurchaseOrder"
                fragment="true"
                partNamespace="{http://example.camel.org/apache}po" />
        </marshal>

 <unmarshal>
            <jaxb prettyPrint="false" contextPath="org.apache.camel.example"
                partClass="org.apache.camel.example.Partial" />
        </unmarshal>
*
What is the value to be entered for contextPath and partNamespace?? I am
confused with that.
If there is a alternate way to handle this, please help me with it..

Reji




--
View this message in context: http://camel.465427.n5.nabble.com/CFX-to-Queue-io-serializationException-tp5739142.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CFX to Queue : io.serializationException

Posted by Christian Müller <ch...@gmail.com>.
Please do not post the same question multiple time in different threads (I
answered your last question in the other thread).
Please spend a bit more time to resolve your issues before posting your
questions.
Please be more patient. Most of the users like me spend his/her spare time
to help others here. Don't be pushy.

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Thu, Sep 12, 2013 at 6:51 AM, contactreji <co...@gmail.com> wrote:

> Hi
>
> I have tried to marshal the exchange coming from cxf endpoint before
> putting
> into the ActiveMQ Queue.
>
> <route id="route_1">
>
>                         <from uri="cxf:bean:PowerConsumptionEndpoint" />
>
>                         <marshal>
>                                 <jaxb prettyPrint="false"
> contextPath="org.apache.camel"  />
>                         </marshal>
>                         <to uri="activemq:REJI_INboundQ" />
>
>                 </route>
>
>
> It gives deployment successful but when data is triggerred, it gives
> following exception
>
> java.io.IOException: javax.xml.bind.JAXBException: class
> org.apache.cxf.message.MessageContentsList nor any of its super class is
> known to this context.
>
> Could you tell me how to modify the configuration so that this error is
> resolved
>
> Reji
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/CXF-to-Apache-ActiveMQ-Queue-io-serializationException-tp5739142p5739203.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: CFX to Queue : io.serializationException

Posted by contactreji <co...@gmail.com>.
Hi 

I have tried to marshal the exchange coming from cxf endpoint before putting
into the ActiveMQ Queue. 

<route id="route_1">

                        <from uri="cxf:bean:PowerConsumptionEndpoint" />
                        
                        <marshal>
                                <jaxb prettyPrint="false"
contextPath="org.apache.camel"  />
                        </marshal>
                        <to uri="activemq:REJI_INboundQ" />

                </route>


It gives deployment successful but when data is triggerred, it gives
following exception 

java.io.IOException: javax.xml.bind.JAXBException: class
org.apache.cxf.message.MessageContentsList nor any of its super class is
known to this context. 

Could you tell me how to modify the configuration so that this error is
resolved 

Reji




--
View this message in context: http://camel.465427.n5.nabble.com/CXF-to-Apache-ActiveMQ-Queue-io-serializationException-tp5739142p5739203.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CFX to Queue : io.serializationException

Posted by contactreji <co...@gmail.com>.
Hi Christian

Thank you so much.  Could you help me with configuring the marshaller.  The
class is something called DTPowerconsumption which has the schema for the
pojo.

I see in Camel jaxb component that there are parameters called contextPath
and namespaces. What should I enter for those values?

Reji

On Thursday, September 12, 2013, Christian Mueller [via Camel] <
ml-node+s465427n5739188h7@n5.nabble.com> wrote:
> Yes, use the camel-jaxb dataformat to marshal your payload into a
> byte[]/String before sending it to the queue. After dequeuing it,
unmarshal
> it to your Java pojo.
>
> Best,
> Christian
> -----------------
>
> Software Integration Specialist
>
> Apache Camel committer: https://camel.apache.org/team
> V.P. Apache Camel: https://www.apache.org/foundation/
> Apache Member: https://www.apache.org/foundation/members.html
>
> https://www.linkedin.com/pub/christian-mueller/11/551/642
>
>
> On Wed, Sep 11, 2013 at 2:27 PM, contactreji <[hidden email]> wrote:
>
>> Hi Guys
>>
>> I have a problem in the following route.
>>
>> *<route id="Route1_MES_Queue">
>>                         <from uri="cxf:bean:PowerConsumptionEndpoint"/>
>>                         <log message="Persisting Message to queue
>> ${body}\n">
>>                                 <description>&lt;bean
>> ref="myBean"/&gt;</description>
>>                         </log>
>>                         <to uri="activemq:queue:EC_InboundQueue" />
>>                 </route>
>> *
>>
>> The data from cxf:bean:PowerConsumptionEndpoint is not able to queue up
 in
>> the message broker. It gives io.serialization exception.
>>
>> I tried modifying as cxf:bean:PowerConsumptionEndpoint?dataFormat=MESSAGE
>> which indeed solved the issue.
>>
>> But I have another route picking the same data from the queue as
>>
>> *
>> <route id="Route2_Queue_SAPPI">
>>                         <from uri="activemq:queue:EC_InboundQueue" />
>>
>>                         <log message="Message dequed Queue ${body}\n">
>>                                 <description>&lt;bean
>> ref="myBean"/&gt;</description>
>>                         </log>
>>                         <to uri="SAPClientInvoker" />
>>                 </route>*
>>
>> Here the SAPClientInvoker is a Java class which makes a webservice call
to
>> SAP PI system. We have followed the WSDL approach and we have a schema
>> class
>> DTPowerConsumption whose object is used to invoke Webservice call to SAP
>> PI.
>> *
>> This is part of SAPClientInvoker Class
>> DTPowerConsumption PC=exchng.getIn().getBody(DTPowerConsumption.class);
>>                 LOGGER.info("\n Data received for Energy Consumption from
>> MES  \n");
>>                 LOGGER.info("\n Sending Request from MES to PI for Energy
>> Consumption
>> \n");
>>
>>                 try {
>>                         LOGGER.info("before invoking");
>>                         sapService.siID59PowerconsumptionAsyncOut(PC);
>>                         LOGGER.info("Response from PI for Energy
>> Consumption");
>>                         exchng.getOut().setBody("Response from PI Energy
>> for consumption");
>>
>> *
>> Now i assume that dataFormat=MESSAGE parameter is fiddling with the
>> original
>> compatible data coming to fuse endpoint and hencethe SAPClientInvoker
>> webservice call is not able to maintain the perfect call to SAP PI. and
SAP
>> PI ends up sending HTTP 500 error code .
>>
>>
>> Can anyone suggest me how to store the data on route 1 without really
>> fiddling with the message formats without serialization exceptions?
>>
>> Or can I use a marshaller before storing it into the Queue and
unmarshaller
>> after fetching it from the queue before calling SAPClinetInvoker?
>>
>> If so can I use Camel component
>>
>> *<marshal>
>>             <jaxb prettyPrint="false"
>> contextPath="org.apache.camel.example"
>>                 partClass="org.apache.camel.example.PurchaseOrder"
>>                 fragment="true"
>>                 partNamespace="{http://example.camel.org/apache}po" />
>>         </marshal>
>>
>>  <unmarshal>
>>             <jaxb prettyPrint="false"
>> contextPath="org.apache.camel.example"
>>                 partClass="org.apache.camel.example.Partial" />
>>         </unmarshal>
>> *
>> What is the value to be entered for contextPath and partNamespace?? I am
>> confused with that.
>> If there is a alternate way to handle this, please help me with it..
>>
>> Reji
>>
>>
>>
>>
>> --
>> View this message in context:
>>
http://camel.465427.n5.nabble.com/CFX-to-Queue-io-serializationException-tp5739142.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
below:
>
http://camel.465427.n5.nabble.com/CXF-to-Apache-ActiveMQ-Queue-io-serializationException-tp5739142p5739188.html
> To unsubscribe from CXF to Apache ActiveMQ Queue :
io.serializationException, click here.
> NAML




--
View this message in context: http://camel.465427.n5.nabble.com/CXF-to-Apache-ActiveMQ-Queue-io-serializationException-tp5739142p5739195.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CFX to Queue : io.serializationException

Posted by contactreji <co...@gmail.com>.
Hi Christain

I was referring the documentation at http://camel.apache.org/jaxb.html

Am i supposed to use

*<marshal>
            <jaxb prettyPrint="false" contextPath="org.apache.camel.example"
                partClass="org.apache.camel.example.PurchaseOrder"
                fragment="true"
                partNamespace="{http://example.camel.org/apache}po" />
        </marshal> *

and 
*
 <unmarshal>
            <jaxb prettyPrint="false" contextPath="org.apache.camel.example"
                partClass="org.apache.camel.example.Partial" />
        </unmarshal>*

If so could you guide me what should be entered for contextPath and
partNamespace? I am new to camel. 

Reji



--
View this message in context: http://camel.465427.n5.nabble.com/CXF-to-Apache-ActiveMQ-Queue-io-serializationException-tp5739142p5739198.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CFX to Queue : io.serializationException

Posted by Christian Müller <ch...@gmail.com>.
Yes, use the camel-jaxb dataformat to marshal your payload into a
byte[]/String before sending it to the queue. After dequeuing it, unmarshal
it to your Java pojo.

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Wed, Sep 11, 2013 at 2:27 PM, contactreji <co...@gmail.com> wrote:

> Hi Guys
>
> I have a problem in the following route.
>
> *<route id="Route1_MES_Queue">
>                         <from uri="cxf:bean:PowerConsumptionEndpoint"/>
>                         <log message="Persisting Message to queue
> ${body}\n">
>                                 <description>&lt;bean
> ref="myBean"/&gt;</description>
>                         </log>
>                         <to uri="activemq:queue:EC_InboundQueue" />
>                 </route>
> *
>
> The data from cxf:bean:PowerConsumptionEndpoint is not able to queue up  in
> the message broker. It gives io.serialization exception.
>
> I tried modifying as cxf:bean:PowerConsumptionEndpoint?dataFormat=MESSAGE
> which indeed solved the issue.
>
> But I have another route picking the same data from the queue as
>
> *
> <route id="Route2_Queue_SAPPI">
>                         <from uri="activemq:queue:EC_InboundQueue" />
>
>                         <log message="Message dequed Queue ${body}\n">
>                                 <description>&lt;bean
> ref="myBean"/&gt;</description>
>                         </log>
>                         <to uri="SAPClientInvoker" />
>                 </route>*
>
> Here the SAPClientInvoker is a Java class which makes a webservice call to
> SAP PI system. We have followed the WSDL approach and we have a schema
> class
> DTPowerConsumption whose object is used to invoke Webservice call to SAP
> PI.
> *
> This is part of SAPClientInvoker Class
> DTPowerConsumption PC=exchng.getIn().getBody(DTPowerConsumption.class);
>                 LOGGER.info("\n Data received for Energy Consumption from
> MES  \n");
>                 LOGGER.info("\n Sending Request from MES to PI for Energy
> Consumption
> \n");
>
>                 try {
>                         LOGGER.info("before invoking");
>                         sapService.siID59PowerconsumptionAsyncOut(PC);
>                         LOGGER.info("Response from PI for Energy
> Consumption");
>                         exchng.getOut().setBody("Response from PI Energy
> for consumption");
>
> *
> Now i assume that dataFormat=MESSAGE parameter is fiddling with the
> original
> compatible data coming to fuse endpoint and hencethe SAPClientInvoker
> webservice call is not able to maintain the perfect call to SAP PI. and SAP
> PI ends up sending HTTP 500 error code .
>
>
> Can anyone suggest me how to store the data on route 1 without really
> fiddling with the message formats without serialization exceptions?
>
> Or can I use a marshaller before storing it into the Queue and unmarshaller
> after fetching it from the queue before calling SAPClinetInvoker?
>
> If so can I use Camel component
>
> *<marshal>
>             <jaxb prettyPrint="false"
> contextPath="org.apache.camel.example"
>                 partClass="org.apache.camel.example.PurchaseOrder"
>                 fragment="true"
>                 partNamespace="{http://example.camel.org/apache}po" />
>         </marshal>
>
>  <unmarshal>
>             <jaxb prettyPrint="false"
> contextPath="org.apache.camel.example"
>                 partClass="org.apache.camel.example.Partial" />
>         </unmarshal>
> *
> What is the value to be entered for contextPath and partNamespace?? I am
> confused with that.
> If there is a alternate way to handle this, please help me with it..
>
> Reji
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/CFX-to-Queue-io-serializationException-tp5739142.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>