[jboss-user] [JBoss Messaging] - Re: MDB - Obejctmessage exception

Michael Brown do-not-reply at jboss.com
Fri Feb 4 09:43:38 EST 2011


Michael Brown [http://community.jboss.org/people/mluisbrown] created the discussion

"Re: MDB - Obejctmessage exception"

To view the discussion, visit: http://community.jboss.org/message/585545#585545

--------------------------------------------------------------
>  
> And I don't understand why 'objects.Student' and not only 'Student'
> 
> 
> So ... the only way to make the bean working is renaming the 'myobjects' package to 'objects'.  The Student class MUST be in the same package.
> 
Your class Student is in the package "objects". When you send a Student object in an object message it is serialized as an object of type "objects.Student". That same class has to be available in your MDB. However, in your MDB code you appear to be referring to a different type of Student class in the package "myobjects", ie: myobjects.Student. You need to import the "objects.Student" class in your MDB code. In Java, two classes with the same name but in different packages are two *totally* different classes that have nothing to do with each other. You're getting the error because the MDB can't find and load the class "objects.Student", which it needs to deserialize the object.

You can ignore what I wrote above about switching classloaders. It looked similar to a problem I was having which was due to a JBoss Messaging bug which I believe was fixed in 5.0.1.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/585545#585545]

Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2042]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110204/2002203c/attachment.html 


More information about the jboss-user mailing list