You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Narita Bagchi <Na...@headstrong.com> on 2011/09/05 05:47:45 UTC

Qpid ObjectMessage problem

I have a simple POC for my problem. I have a producer and a consumer to read and write ObjectMessage to Qpid queue. All that the Dummy object has, is a String. The Dummy object is Serializable as well. Producer seems to be writing the object to the queue without throwing an error but the Consumer which is listening to the queue, is not able to de-serialize the Dummy object.

OnMessage (on receiving the message), a simple
Dummy dummyObj = (Dummy)((JMSObjectMessage)arg0).getObject();
throws the following error -

javax.jms.MessageFormatException: Could not deserialize message: java.io.EOFException
            at org.apache.qpid.client.message.JMSObjectMessage.getObject(JMSObjectMessage.java:146)
            at producer.QpidConsumer.onMessage(QpidConsumer.java:81)

I have also checked that the Dummy object is getting serialized/deserialized without any problem in a simple POC to test serialization. I don't know what I am missing.
Please help.

Thanks.


________________________________
***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Re: Qpid ObjectMessage problem

Posted by Ioannis Canellos <io...@gmail.com>.
>
> "On Inspect, the method call works fine but fails in resumed debug
> execution."
>

If you deserialize the message with inspect, then its normal the it will
fail when you resume, since the object is already read.

-- 
*Ioannis Canellos*
*
 http://iocanel.blogspot.com

Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*

RE: Qpid ObjectMessage problem

Posted by Narita Bagchi <Na...@headstrong.com>.
Yeah! I totally agree and am eagerly waiting for a clearance on that :) Right now I don't have the authority to do that. Coming back to the problem...
Can you give me an insight to, in what circumstances the following behavior occurs?

"On Inspect, the method call works fine but fails in resumed debug execution."

Thanks.
Regards,
Narita


-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
Sent: Monday, September 05, 2011 3:09 PM
To: users@camel.apache.org
Subject: Re: Qpid ObjectMessage problem

On Mon, Sep 5, 2011 at 11:35 AM, Narita Bagchi
<Na...@headstrong.com> wrote:
>
> Camel 1.6.4
> I have a customized endpoint to support Qpid connectivity, which underlying is using "amqp".
>

That uses a very old apache qipd release. The ampq spec. has changed
dramatically over the years.
I suggest to look at the latest source code in camel-ampq, and try to
upgrade your camel 1.x camel-amqp so
it uses the latest apache qpid release as well.


> Thanks.
> Regards,
> Narita
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Monday, September 05, 2011 2:56 PM
> To: users@camel.apache.org
> Subject: Re: Qpid ObjectMessage problem
>
> What version of Camel are you using? And are you use the camel-amqp component?
>
> On Mon, Sep 5, 2011 at 10:48 AM, Narita Bagchi
> <Na...@headstrong.com> wrote:
>>
>> Full stack trace -
>>
>> javax.jms.MessageFormatException: Could not deserialize message: java.io.EOFException
>>        at org.apache.qpid.client.message.JMSObjectMessage.getObject(JMSObjectMessage.java:146)
>>        at consumer.test.onMessage(QpidConsumer.java:83)
>>        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:719)
>>        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:656)
>>        at org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3043)
>>        at org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:2966)
>>
>>
>> Following things I tried -
>> 1) I created a separate POC to serialize/de-serialize the "Dummy" instance to/from a text file. I ensured using the same API that does the serialization/de-serialization inside org.apache.qpid.client.message.JMSObjectMessage. This worked. That ensures that there is no problem with the "Dummy" instance.
>> 2) I tried a simpler thing - writing String ObjectMessage  onto the queue. Like session.createObjectMessage(new String("XYZ")); and producer.send(objMessage);
>> This did not work. I thought probably I am missing out something in the connection set up phase or making some mistake during queue creation. But I could not figure out anything wrong.
>> 3) I happened to do an "Inspect" on "(String) ((ObjectMessage) arg0).getObject();", which works fine. But if I resume the debug point, the exception is thrown.
>>
>> At this stage, I can guessing 2 things - 1) Either it is a JVM problem or 2) Probably the message is getting consumed twice, and during the second attempt this exception is thrown.
>>
>> But the big clue here is -
>> On "Inspect", the method call works fine but fails in resumed debug execution.
>>
>> I'll update, once I find the next clue.
>> Thanks.
>> Regards,
>> Narita
>>
>>
>> -----Original Message-----
>> From: Ioannis Canellos [mailto:iocanel@gmail.com]
>> Sent: Monday, September 05, 2011 1:45 PM
>> To: users@camel.apache.org
>> Subject: Re: Qpid ObjectMessage problem
>>
>> Could you please paste the full stack trace?
>> --
>> *Ioannis Canellos*
>> *
>>  http://iocanel.blogspot.com
>>
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> Apache ServiceMix <http://servicemix.apache.org/>  Committer
>> Apache Gora <http://incubator.apache.org/gora/> Committer
>> *
>>
>> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***
>>
>
>
>
> --
> 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/
>
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***
>



--
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/

***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Re: Qpid ObjectMessage problem

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Sep 5, 2011 at 11:35 AM, Narita Bagchi
<Na...@headstrong.com> wrote:
>
> Camel 1.6.4
> I have a customized endpoint to support Qpid connectivity, which underlying is using "amqp".
>

That uses a very old apache qipd release. The ampq spec. has changed
dramatically over the years.
I suggest to look at the latest source code in camel-ampq, and try to
upgrade your camel 1.x camel-amqp so
it uses the latest apache qpid release as well.


> Thanks.
> Regards,
> Narita
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Monday, September 05, 2011 2:56 PM
> To: users@camel.apache.org
> Subject: Re: Qpid ObjectMessage problem
>
> What version of Camel are you using? And are you use the camel-amqp component?
>
> On Mon, Sep 5, 2011 at 10:48 AM, Narita Bagchi
> <Na...@headstrong.com> wrote:
>>
>> Full stack trace -
>>
>> javax.jms.MessageFormatException: Could not deserialize message: java.io.EOFException
>>        at org.apache.qpid.client.message.JMSObjectMessage.getObject(JMSObjectMessage.java:146)
>>        at consumer.test.onMessage(QpidConsumer.java:83)
>>        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:719)
>>        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:656)
>>        at org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3043)
>>        at org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:2966)
>>
>>
>> Following things I tried -
>> 1) I created a separate POC to serialize/de-serialize the "Dummy" instance to/from a text file. I ensured using the same API that does the serialization/de-serialization inside org.apache.qpid.client.message.JMSObjectMessage. This worked. That ensures that there is no problem with the "Dummy" instance.
>> 2) I tried a simpler thing - writing String ObjectMessage  onto the queue. Like session.createObjectMessage(new String("XYZ")); and producer.send(objMessage);
>> This did not work. I thought probably I am missing out something in the connection set up phase or making some mistake during queue creation. But I could not figure out anything wrong.
>> 3) I happened to do an "Inspect" on "(String) ((ObjectMessage) arg0).getObject();", which works fine. But if I resume the debug point, the exception is thrown.
>>
>> At this stage, I can guessing 2 things - 1) Either it is a JVM problem or 2) Probably the message is getting consumed twice, and during the second attempt this exception is thrown.
>>
>> But the big clue here is -
>> On "Inspect", the method call works fine but fails in resumed debug execution.
>>
>> I'll update, once I find the next clue.
>> Thanks.
>> Regards,
>> Narita
>>
>>
>> -----Original Message-----
>> From: Ioannis Canellos [mailto:iocanel@gmail.com]
>> Sent: Monday, September 05, 2011 1:45 PM
>> To: users@camel.apache.org
>> Subject: Re: Qpid ObjectMessage problem
>>
>> Could you please paste the full stack trace?
>> --
>> *Ioannis Canellos*
>> *
>>  http://iocanel.blogspot.com
>>
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> Apache ServiceMix <http://servicemix.apache.org/>  Committer
>> Apache Gora <http://incubator.apache.org/gora/> Committer
>> *
>>
>> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***
>>
>
>
>
> --
> 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/
>
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***
>



-- 
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: Qpid ObjectMessage problem

Posted by Narita Bagchi <Na...@headstrong.com>.
Camel 1.6.4
I have a customized endpoint to support Qpid connectivity, which underlying is using "amqp".

Thanks.
Regards,
Narita

-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
Sent: Monday, September 05, 2011 2:56 PM
To: users@camel.apache.org
Subject: Re: Qpid ObjectMessage problem

What version of Camel are you using? And are you use the camel-amqp component?

On Mon, Sep 5, 2011 at 10:48 AM, Narita Bagchi
<Na...@headstrong.com> wrote:
>
> Full stack trace -
>
> javax.jms.MessageFormatException: Could not deserialize message: java.io.EOFException
>        at org.apache.qpid.client.message.JMSObjectMessage.getObject(JMSObjectMessage.java:146)
>        at consumer.test.onMessage(QpidConsumer.java:83)
>        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:719)
>        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:656)
>        at org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3043)
>        at org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:2966)
>
>
> Following things I tried -
> 1) I created a separate POC to serialize/de-serialize the "Dummy" instance to/from a text file. I ensured using the same API that does the serialization/de-serialization inside org.apache.qpid.client.message.JMSObjectMessage. This worked. That ensures that there is no problem with the "Dummy" instance.
> 2) I tried a simpler thing - writing String ObjectMessage  onto the queue. Like session.createObjectMessage(new String("XYZ")); and producer.send(objMessage);
> This did not work. I thought probably I am missing out something in the connection set up phase or making some mistake during queue creation. But I could not figure out anything wrong.
> 3) I happened to do an "Inspect" on "(String) ((ObjectMessage) arg0).getObject();", which works fine. But if I resume the debug point, the exception is thrown.
>
> At this stage, I can guessing 2 things - 1) Either it is a JVM problem or 2) Probably the message is getting consumed twice, and during the second attempt this exception is thrown.
>
> But the big clue here is -
> On "Inspect", the method call works fine but fails in resumed debug execution.
>
> I'll update, once I find the next clue.
> Thanks.
> Regards,
> Narita
>
>
> -----Original Message-----
> From: Ioannis Canellos [mailto:iocanel@gmail.com]
> Sent: Monday, September 05, 2011 1:45 PM
> To: users@camel.apache.org
> Subject: Re: Qpid ObjectMessage problem
>
> Could you please paste the full stack trace?
> --
> *Ioannis Canellos*
> *
>  http://iocanel.blogspot.com
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache ServiceMix <http://servicemix.apache.org/>  Committer
> Apache Gora <http://incubator.apache.org/gora/> Committer
> *
>
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***
>



--
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/

***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Re: Qpid ObjectMessage problem

Posted by Claus Ibsen <cl...@gmail.com>.
What version of Camel are you using? And are you use the camel-amqp component?

On Mon, Sep 5, 2011 at 10:48 AM, Narita Bagchi
<Na...@headstrong.com> wrote:
>
> Full stack trace -
>
> javax.jms.MessageFormatException: Could not deserialize message: java.io.EOFException
>        at org.apache.qpid.client.message.JMSObjectMessage.getObject(JMSObjectMessage.java:146)
>        at consumer.test.onMessage(QpidConsumer.java:83)
>        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:719)
>        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:656)
>        at org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3043)
>        at org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:2966)
>
>
> Following things I tried -
> 1) I created a separate POC to serialize/de-serialize the "Dummy" instance to/from a text file. I ensured using the same API that does the serialization/de-serialization inside org.apache.qpid.client.message.JMSObjectMessage. This worked. That ensures that there is no problem with the "Dummy" instance.
> 2) I tried a simpler thing - writing String ObjectMessage  onto the queue. Like session.createObjectMessage(new String("XYZ")); and producer.send(objMessage);
> This did not work. I thought probably I am missing out something in the connection set up phase or making some mistake during queue creation. But I could not figure out anything wrong.
> 3) I happened to do an "Inspect" on "(String) ((ObjectMessage) arg0).getObject();", which works fine. But if I resume the debug point, the exception is thrown.
>
> At this stage, I can guessing 2 things - 1) Either it is a JVM problem or 2) Probably the message is getting consumed twice, and during the second attempt this exception is thrown.
>
> But the big clue here is -
> On "Inspect", the method call works fine but fails in resumed debug execution.
>
> I'll update, once I find the next clue.
> Thanks.
> Regards,
> Narita
>
>
> -----Original Message-----
> From: Ioannis Canellos [mailto:iocanel@gmail.com]
> Sent: Monday, September 05, 2011 1:45 PM
> To: users@camel.apache.org
> Subject: Re: Qpid ObjectMessage problem
>
> Could you please paste the full stack trace?
> --
> *Ioannis Canellos*
> *
>  http://iocanel.blogspot.com
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache ServiceMix <http://servicemix.apache.org/>  Committer
> Apache Gora <http://incubator.apache.org/gora/> Committer
> *
>
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***
>



-- 
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: Qpid ObjectMessage problem

Posted by Narita Bagchi <Na...@headstrong.com>.
Full stack trace -

javax.jms.MessageFormatException: Could not deserialize message: java.io.EOFException
        at org.apache.qpid.client.message.JMSObjectMessage.getObject(JMSObjectMessage.java:146)
        at consumer.test.onMessage(QpidConsumer.java:83)
        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:719)
        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:656)
        at org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3043)
        at org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:2966)


Following things I tried -
1) I created a separate POC to serialize/de-serialize the "Dummy" instance to/from a text file. I ensured using the same API that does the serialization/de-serialization inside org.apache.qpid.client.message.JMSObjectMessage. This worked. That ensures that there is no problem with the "Dummy" instance.
2) I tried a simpler thing - writing String ObjectMessage  onto the queue. Like session.createObjectMessage(new String("XYZ")); and producer.send(objMessage);
This did not work. I thought probably I am missing out something in the connection set up phase or making some mistake during queue creation. But I could not figure out anything wrong.
3) I happened to do an "Inspect" on "(String) ((ObjectMessage) arg0).getObject();", which works fine. But if I resume the debug point, the exception is thrown.

At this stage, I can guessing 2 things - 1) Either it is a JVM problem or 2) Probably the message is getting consumed twice, and during the second attempt this exception is thrown.

But the big clue here is -
On "Inspect", the method call works fine but fails in resumed debug execution.

I'll update, once I find the next clue.
Thanks.
Regards,
Narita


-----Original Message-----
From: Ioannis Canellos [mailto:iocanel@gmail.com]
Sent: Monday, September 05, 2011 1:45 PM
To: users@camel.apache.org
Subject: Re: Qpid ObjectMessage problem

Could you please paste the full stack trace?
--
*Ioannis Canellos*
*
 http://iocanel.blogspot.com

Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*

***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Re: Qpid ObjectMessage problem

Posted by Ioannis Canellos <io...@gmail.com>.
Could you please paste the full stack trace?
-- 
*Ioannis Canellos*
*
 http://iocanel.blogspot.com

Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*