Meaningless Drivel is fun!
The moose likes EJB and other Java EE Technologies and the fly likes Exception in receiving ObjectMessage in JMS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Exception in receiving ObjectMessage in JMS" Watch "Exception in receiving ObjectMessage in JMS" New topic

Exception in receiving ObjectMessage in JMS

Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130
I want to develop message layer for application to exchange text and serialized object using JMS. The application is working well when TextMessage is passed but throw exception when object message is passed.
Plz give the name of the JMS vendor name on which you test ObjectMessage messaging service working.
My code is :
try {
correlationID = mess.getJMSCorrelationID();
System.out.println(LID +" correlationID = "+correlationID);
if(mess instanceof ObjectMessage) {
oMessages = (ObjectMessage) mess;
System.out.println(LID + "mess instanceof ObjectMessage");
//R16 is Serializable
r16 = (R16) oMessages.getObject(); //fail here
} catch(JMSException jmse){
Logger.debug( LID , jmse );
And the exception is :
javax.jms.MessageFormatException: Error in Deserializing Object Message.Class not found
Please share your experience with me
Thanks in Advance

Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
Phil Rhodes
Ranch Hand

Joined: Dec 27, 2003
Posts: 65
it sounds like something you're trying to deserialize isn't being found on the receiving end. Is the r16 available in the classpath on the receive side?
I've had no problems using ObjectMessage before, using JBossMQ, FWIW.. but I've only mostly been sending objects that were part of the Java class library, and would therefore presumably never have any kind of classpath problem.

A+, Network+, SCJP, SCWCD<br />preparing for SCBCD, SCEA, CompTIA I-Net+
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
Depending on the host of your JMS messaging(I am not sure what J2EE compliant server you might be using) some times there is class loader issues. I would check with the class path on the receiving end and class finder issues from the J2EE vendor.

SCJP, blog
I agree. Here's the link:
subject: Exception in receiving ObjectMessage in JMS
It's not a secret anymore!