[jbossws-dev] [Design of JBoss Web Services] - Re: WSContractConsumer API in a seam app

jason.greene@jboss.com do-not-reply at jboss.com
Mon Feb 26 12:33:33 EST 2007


"maeste" wrote : Ops, something went wrong in my last post and the final part of my message doesn't be visible:
  | "jason.greene at jboss.com" wrote :  
  |   | 
  |   | Be careful when replacing the context loader when running in a container. If you do this you should restore the original thread context loader.
  |   | 
  |   | -Jason
  | I suspected it is too aggressive. What is the best way to tell the current class loader to include also my generated client class?
  | 
  | Many many tanks for your time

You don't actually need to mess with the context classloader. Once a class is loaded you can freely pass the class reference around. The JVM associates the class reference to the loader that loaded it, and that loader is preserved until all class references are garbage collected. The only scenario to replace a context loader is if you are using an API that uses it, and doesnt offer a mechanism to pass the loader directly. However, when you do this you must use a try finally block that restores the context loader to the original version.

So, your problems might go away if remove the context loader assignment, and the RMIAdaptor hack.

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

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



More information about the jbossws-dev mailing list