tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
Subject Re: MBean InitialContext() Tomcat query- pls help
Date Thu, 22 Dec 2011 10:34:43 GMT
2011/12/20 S B <>:
> Hi,
> I created and deployed an MBean in my tomcat. It uses datasource to connect
> to DB.
> My questions is:
> When I create InitialContext() inside MBean's constructor and pass the
> envContext to DBManager class to lookup datasource it works fine. However
> when I create InitialContext() in DBManager  class, it fails.

IIRC what InitialContext() sees as its environment highly depends on
what classloader is active. That is TCCL =

So while it is run from within web application your TCCL = your
webapp's classloader.

When it is invoked from jconsole it might be a separate Thread, not
related to your web application.

Best regards,
Konstantin Kolinko

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message