RE: javax.jms.MessageFormatException

"Tim Anderson" <[email protected]>
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
I suspect the problem is occurring because the openjms client jar is in a
different
class loader to that of your app. If you include the client jar in your
webapp, along with
the jar containing BeanUser, the problem should go away. 
 
-Tim


  _____  

From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
BHansard-OwnAfhDu3djtGJWAWb0rHTP0h3Fy0YSOAL8bYrjMMd8@public.gmane.org
Sent: Tuesday, 5 July 2005 11:49 PM
To: [email protected]
Cc: [email protected];
openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [openjms-user] javax.jms.MessageFormatException



The Sender and Receiver are running under two seperate JVMs

Here is a sample of the stack using the code you provided:

java.lang.ClassNotFoundException: com.rockwell.powersystems.beans.BeanUser
at
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader
.java:844)
at
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader
.java:709)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:574)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at
org.exolab.jms.message.ObjectMessageImpl.getObject(ObjectMessageImpl.java:21
5)

This would appear to be a class path issue. I added a line of code to test
the classpath just before the message.getObject();:

com.rockwell.powersystems.beans.BeanUser testUser = new
com.rockwell.powersystems.beans.BeanUser()
logger.info("Test User: " + testUser);

2005-07-05 09:07:45,101 INFO com.rockwell.amts.actions.RetrieveUserProfile -
Test User: com.rockwell.powersystems.beans.BeanUser@113cd63

The only thing I can think is the the multiple JVM is causing a signature
issue on the class under Linux.


Inactive hide details for "Tim Anderson" <[email protected]>"Tim Anderson"
<[email protected]>






	"Tim Anderson" <[email protected]> 
Sent by: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org 

	07/02/2005 11:44 PM 

	

	Please respond to
[email protected]




To

<[email protected]>	



cc

	



Subject

RE: [openjms-user] javax.jms.MessageFormatException	
	 	

The object is failing to deserialize.
Have you included the bean and its dependencies in your classpath
on the Linux client? Not clear from your post if the sender and receiver
are in the same JVM.

You can get the root cause of the problem by:
try {
Object obj = message.getObject();
} catch (JMSException e) {
e.getLinkedException().printStackTrace();
}

-Tim



  _____  

From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
BHansard-OwnAfhDu3djtGJWAWb0rHTP0h3Fy0YSOAL8bYrjMMd8@public.gmane.org
Sent: Saturday, 2 July 2005 1:18 AM
To: [email protected]
Subject: [openjms-user] javax.jms.MessageFormatException


Hello all,

I have a quick question. I am running OpenJMS 0.7.6.1 on a RedHat Enterprise
Linux Server w Java 1.5. 

I have a JavaBean defined as:

public class XyzBean extends Object implements Serializable

I place the Bean on a Queue using the 

ObjectMessage msg = session.createObjectMessage(xyzBean );

I retrieve the message with:

QueueReceiver reciever = session.createReceiver(queue, selector);
ObjectMessage message = (ObjectMessage) reciever.receive(2000);
XyzBean xyzBean = (XyzBean) message.getObject();

However this will throw a javax.jms.MessageFormatException: package.Xyzbean
error

I run the same code on a Windows 2000 Server running Java 1.5 and OpenJMS
0.7.6.1 and it works without a problem.

Does anyone know what might be causing this issue on the Linux Machine?
graycol.gif (image/gif, 105 B) - not displayed
ecblank.gif (image/gif, 45 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.