[jboss-user] [EJB3] - Re: Why does Thread.getContextClassLoader in an stateless bean r

Ilya Sorokoumov do-not-reply at jboss.com
Sat Jan 15 02:08:03 EST 2011

Ilya Sorokoumov [http://community.jboss.org/people/ilya40umov] created the discussion

"Re: Why does Thread.getContextClassLoader in an stateless bean r"

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

I guess that this is a normal behavior for J2EE 5 container. Because every war file(inside or outside ear) has its own classloader. For instance I have there war files in my ear and they all have there own copies of my singletons. Another thing is that EJB application has its own classloader and when you call these methods the first string returns your war classloader and the second returns EJB app classloader.
I guess that if you try to call the same ejb from a standalone client you will find that Thread's classloader is a classloader of this client(I'm not quite sure about this one).
If you want to read some additional info take a look at the following link:
 http://community.jboss.org/docs/DOC-9288 http://community.jboss.org/wiki/classloadingconfiguration

Reply to this message by going to Community

Start a new discussion in EJB3 at Community

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

More information about the jboss-user mailing list