You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Julian Payne <jp...@ilog.fr> on 2001/04/09 15:40:46 UTC

Using JNDI with Jakarta-Tomcat 4.0 beta 3

Hi,

I have been using Jakarta-Tomcat 3.2.1 and when I upgraded to the 4.0 beta 3
I have a propblem with my JNDI configuration.

I have a servlet that uses an EJB container that requires the following
"jndi.properties" :

java.naming.factory.initial
com.sun.jndi.rmi.registry.RegistryContextFactory
java.naming.provider.url             rmi://localhost:1099
java.naming.factory.url.pkgs       org.objectweb.jonas.naming

With 3.2.1 I just needed to make sure that I had my jndi.properties file on
the classpath, with 4.0 beta 3 I do not seem to be able to get this read by
any means. The only mechanism that I found to get this to work is if I call
"System.setProperty()" in my servlet just before I call "new
javax.naming.InitialContext()". If I do not do this I get the following
error message:

javax.naming.NoInitialContextException: Cannot instantiate class:
org.apache.naming.java.javaURLContextFactory.  Root exception is
java.lang.ClassCastException: org.apache.naming.java.javaURLContextFactory


Can anyone tell me how I am supposed to set this for my servlet? I tried the
following without any success:

1) Using env-entry in my WEB-INF/web.xml
2) Putting the jndi.properties into the classpath
3) Using <Resource> in the server.xml (except that I was not sure of the
correct parameters to use...)

Thanks for any help,

Julian Payne
ILOG. S.A.
Sophia Antipolis,
France