[jboss-user] [JBoss Messaging] - JBoss Messaging - classcast exception

prabhun do-not-reply at jboss.com
Mon Oct 6 10:24:54 EDT 2008


We are migrating our project from Jboss MQ to Jboss Messaging.
The following scenario works fine in Jboss MQ however it does not work in Jboss Messaging:

Object A is a publisher, which publishes the messages to a JMStopic.
Object B is a subscriber to topic.
Object C is another subscriber to same topic.

All 3 are individual J2ee projects using isolated (individual) Class loaders.

A publishes the message, B and C reads the message.

·	B reads the message successfully and works fine.
·	When C reads the message the actual class is loaded from classloader of B instead of classloader of C (runtime,object class loader path shows the class is loaded from B). Hence class cast exception occurs.

Code in B
 public void onMessage(Message message) {

// message object is loaded from classloader of B.No exception


Code in C
 public void onMessage(Message message) {

// Message object is loaded from classloader of B, it was suppose to be loaded from classloder of C.Hence class cast exception occurs.


It looks like a Class Loader problem while using the Jboss Messaging.

Is it a bug or we need to do any additional configuration to fix this issue? 
If any one has come across this classcast exception please let us know the fix for this.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180584#4180584

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180584

More information about the jboss-user mailing list