tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
Subject Re: Tomcat 7.0.47 Websocket + JNDI problems
Date Sun, 27 Oct 2013 22:41:15 GMT
2013/10/28 Francesco Bassi <>:
> Hello everybody.
> I just downloaded 7.0.47 and updated one web application that I developed
> in order to use the new standard JSR 356 websocket implementation.
> With this new implementation, I noticed that during the processing of
> incoming websocket events, it's not possible to access the JNDI resources.
> ie:
>             Context initCtx = new InitialContext();
>             Context c = (Context) initCtx.lookup("java:comp/env");
> gives
> javax.naming.NameNotFoundException: Name [comp/env] is not bound in this
> Context. Unable to find [comp].
> I'm using a custom ServerEndpointConfig.Configurator.
> Everything used to work properly with the old custom tomcat implementation.
> Is it an expected behaviour?

I think it means that  the thread where you process those events does
not have its Thread.getContextClassLoader() (aka TCCL) configured and
thus JNDI does not know to what web application this thread belongs.

Can you provide the stack trace of the place where you access JNDI
and check what is the value of
Thread.currentThread().getContextClassLoader() there?

If the class loader is not a o.a.c.loader.WebappClassLoader one, I
think it is OK to create a bugzilla issue.

Best regards,
Konstantin Kolinko

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

View raw message