Hi,
I am getting following error while trying to receive a ObjectMessage.
Exception in
thread "main" weblogic.jms.common.JMSException: Error deserializing
object
at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.jav
a:140)
at JMSReceiver.main(JMSReceiver.java:65)
----------- Linked Exception -----------
java.io.InvalidClassException: org.jdom.Document; local class incompatible: stre
am classdesc serialVersionUID = 607431889463202798, local class serialVersionUID
= -3468405884372921646
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.jav
a:128)
at JMSReceiver.main(JMSReceiver.java:65)
----------- Linked Exception -----------
java.io.InvalidClassException: org.jdom.Document; local class incompatible: stre
am classdesc serialVersionUID = 607431889463202798, local class serialVersionUID
= -3468405884372921646
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.jav
a:128)
at JMSReceiver.main(JMSReceiver.java:65)
This is the code where I am sending Document object
// locating connection factory
QueueConnectionFactory connectionFactory = (QueueConnectionFactory)context.lookup("ALConnectionFactory");
//locating queue
Queue queue= (Queue) context.lookup("Queue");
// create the connection
QueueConnection connection = connectionFactory.createQueueConnection();
// establishing the session
QueueSession session = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
// creating sender
QueueSender sender = session.createSender(queue);
// create the message
//TextMessage msg = session.createTextMessage("this is sample queue from the JPO");
ObjectMessage msg = session.createObjectMessage((Serializable)
doc);
// sends the message
sender.send(msg,DeliveryMode.NON_PERSISTENT, 4, 0);
//System.out.println(connectionFactory);
//System.out.println(queue);
connection.close();
session.close();
And this the code where I am trying to receive the Document object
QueueConnectionFactory connectionFactory = (QueueConnectionFactory)context.lookup("ALConnectionFactory");
//locating queue
Queue queue= (Queue) context.lookup("Queue");
// create the connection
QueueConnection connection = connectionFactory.createQueueConnection();
// establishing the session
QueueSession session = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
// creating receiver
QueueReceiver receiver = session.createReceiver(queue);
// start the connection this is different b/n sender and receiver
connection.start();
//TextMessage msg = (TextMessage)receiver.receive();
// start
ObjectMessage msg = (ObjectMessage)receiver.receive();
Document doc = (Document) msg.getObject();
Please help me resolving this problem
Thanks
Nuthan