tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Willis" <agwil...@geocities.com>
Subject trouble with JNDI InitialContexts
Date Thu, 30 Mar 2000 23:41:05 GMT
I'm trying to write a servlet that deals with an LDAP server through JNDI.
I've put all of the JNDI jars into my lib directory, but I'm having trouble
creating an InitialContext.  The problem seems to be that the JNDI library
cannot find the context factory.  I'm confused though because I've looked at
the jar files in the lib directory and one of them contains the class in
question.  I've even used javap to look at the class in the jar to make sure
it has not been corrupted.  The system is able to load other classes from
those jars without a problem.  The issue seems to be around the
Class.forName line (which I assume is used deep within the JNDI library
because I pass in the name of the factory class it should instantiate it
when I try to get an initial context).

I'm running this on the build from two days ago.  Anyone have any ideas
about what is going on?  The exception that I'm seeing is below.


Thanks!
-Andrew




javax.naming.NoInitialContextException: Cannot instantiate class:
com.sun.jndi.ldap.LdapCtxFactory.  Root exception is
java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java, Compiled Code)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java, Compiled
Code)
        at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java,
Compiled Code)
        at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:199)
        at
com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:49)
        at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:660)
        at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
        at javax.naming.InitialContext.init(InitialContext.java:226)
        at javax.naming.InitialContext.<init>(InitialContext.java:202)
        at
javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:87)
        at ldapTool.CreateUserServlet.service(CreateUserServlet.java:67)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled
Code)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java, Compiled Code)
        at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
        at java.lang.Thread.run(Thread.java, Compiled Code)


Mime
View raw message