2013/10/28 Francesco Bassi <fvba...@gmail.com>: > 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: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org