tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: JNDI lookup failure with tomcat 8.5.6
Date Fri, 04 Nov 2016 10:46:41 GMT
On 04/11/2016 10:45, padma T wrote:
> Hi,
> 
> Getting ,JNDI lookup failed exception while starting tomcat 8.
> 
> While debugging it was found that getInitialContext()
> of org.apache.naming.java.javaURLContextFactory class returns NamingContext
> context instead of the custom ContextClassLoader set by our application
>  and the reason is "ContextBindings.isClassLoaderBound()"  return false for
> application's custom ContextClassLoader.
> 
> Code to set custom contextloader :
> 
> Thread.currentThread().setContextClassLoader(classLoader);
> 
> 
> Please let me know if i have to do any configurations for tomcat 8, to
> resolve this issue .

Any custom class loader needs to have the web application class loader
as a parent to pick up JNDI resources.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message