You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Roland Huss <Ro...@consol.de> on 2001/03/08 11:01:22 UTC

struts, tomcat and own JNDI service provider

Ahoi,

I have a problem with tomcat 3.2.1, stuts, Jdk 1.3 and JNDI. In our
struts application we are using an own JNDI provider for looking up
plugins. However, since we are using JDK 1.3, which includes the
javax.naming packages itself, they are always loaded by the system
classloader. Hence, our very own JNDI-SP residing below
WEB-INF/classes is not found and an ClassNotFound exception is
thrown. Putting jndi.jar from sun into WEB-INF/lib doesn't work,
either. The only solution we came up so far was to put all out application
classes and struts.jar into tomcat's CLASSPATH, which is really a bad
idea.

Are there any other, better ways to get tomcat to load the
javax.naming packages with the webapp-class loader ?

thanx, cu...
-- 
							...roland huss
						             consol.de

[ The subject might be slightly off-topic. But since there has
been already some extensive discussion on classloaders in this list and
the problem also concerns any struts app using own JNDI-provider with
tomcat, I hope I'm not too far away from the list. ]


Re: struts, tomcat and own JNDI service provider

Posted by Maya Muchnik <mm...@pumatech.com>.
Roland,

I think, you can specify JNDI provider in env.put statements.

Or alternative way to set the following lines in jndi.properties file (marked
with red - replace with your implementation):

java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
java.naming.factory.url.pkgs=your_path

Maya

Roland Huss wrote:

> Ahoi,
>
> I have a problem with tomcat 3.2.1, stuts, Jdk 1.3 and JNDI. In our
> struts application we are using an own JNDI provider for looking up
> plugins. However, since we are using JDK 1.3, which includes the
> javax.naming packages itself, they are always loaded by the system
> classloader. Hence, our very own JNDI-SP residing below
> WEB-INF/classes is not found and an ClassNotFound exception is
> thrown. Putting jndi.jar from sun into WEB-INF/lib doesn't work,
> either. The only solution we came up so far was to put all out application
> classes and struts.jar into tomcat's CLASSPATH, which is really a bad
> idea.
>
> Are there any other, better ways to get tomcat to load the
> javax.naming packages with the webapp-class loader ?
>
> thanx, cu...
> --
>                                                         ...roland huss
>                                                              consol.de
>
> [ The subject might be slightly off-topic. But since there has
> been already some extensive discussion on classloaders in this list and
> the problem also concerns any struts app using own JNDI-provider with
> tomcat, I hope I'm not too far away from the list. ]