[jboss-user] [JBoss Messaging] - Re: MDB - Obejctmessage exception
Michael Brown
do-not-reply at jboss.com
Wed Feb 2 13:23:10 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/585000#585000
--------------------------------------------------------------
This is a bug, as mentioned in this thread http://community.jboss.org/message/517604#517604 http://community.jboss.org/message/517604#517604 , allthough supposedly it has been fixed in JBoss 5.0.1 GA.
The workaround which I am using is mentioned in the thread, but here it is again:
{code}
logger.info("ObjectMessage Detected");
Student st = null;
// get the current TCCL
ClassLoader originalTCCL = Thread.currentThread().getContextClassLoader();
try
{
// temporarily change TCCL
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
ObjectMessage om = (ObjectMessage) message;
logger.info("ObjectMessage Created");
Student s = (Student) om.getObject();
logger.info("Student created");
logger.info(s.toString());
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
// set back the original TCCL
Thread.currentThread().setContextClassLoader(originalTCCL);
}
logger.info("Object Message : "+st.toString());
{code}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/585000#585000]
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/20110202/5f9dca6c/attachment.html
More information about the jboss-user
mailing list