[jboss-user] [JBoss Messaging] - Re: ClassCastException using same jar file

clebert.suconic@jboss.com do-not-reply at jboss.com
Wed Oct 29 15:04:36 EDT 2008


You are using Messageconsumer inside the Container. i.e. you are spawning threads inside a WebContainer and you're not supposed to do that.

Because of what you're doing you don't have the Thread.contextClassLoader set when onmessage is being called.


To validate what I am saying, you could try this:


onmessage()
  | {
  |     ClassLoader original = Thread.currentThread().getContextClassLoader();
  |     try
  |     {
  |          Thread.currentthread().setContextClassLoader(this.getClass().getClassLoader());
  | /// ..............
  |     }
  |     finally
  |     {
  |          Thread.currentThread.setContextClassLoader(original);
  |     }
  | }

Now.. is there any good reason for you being using MessageConsumer inside the WebContainer?

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

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



More information about the jboss-user mailing list