Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in receiving ObjectMessage in JMS

 
Syed Saifuddin
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
----------------------------------------------------------------------------
Hello,
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){
jmse.printStackTrace();
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
----------------------------------------------------------------------------
 
Phil Rhodes
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Dan.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic