FWIW I run EJB's from an Oracle Application server
and Tomcat in the middle. I have encountered exactly the same exceptions
and they have always turned out to be because Tomcat has failed
to load various jar files such as jndi.jar or whatever. Try 
putting these in TOMCAT_HOME/lib or on a global classpath.
You could even try extracting it! 

Chris.  


-----Original Message-----
From: Aaron Mulder [mailto:[EMAIL PROTECTED]]
Sent: 02 November 2000 21:35
To: jBoss
Cc: [EMAIL PROTECTED]
Subject: Re: [jBoss-User] Naming exception in standalone Tomcat


        This is something that used to work and seems to have stopped
working.  It's not clear whether it was a Tomcat change or a jBoss change
that caused the problem, but we are aware of it.  As a workaround, you can
manually load the jndi.properties file into a properties object or the
system properties.  Also, the new embedded tomcat service should solve
that problem if you're running the two products in the same VM, but the
directions for that are not yet in the manual.
        For the benefit of the Tomcat folks, I think the JNDI code uses
getResources to look for jndi.properties, which is not implemented in
AdaptiveClassLoader, but I'm pretty sketchy on that, and I don't know why
it would have worked before (unless this was caused by one of the Linux
JDK 1.3 updates?).  Unfortunately the JNDI code is pretty grim.

Aaron

On Thu, 2 Nov 2000, Alexander Kogan wrote:
> Hello,
> 
> Sorry for raising this topic again, but I just
> want to clear up this.
> 
> I'm running jboss BETA-PROD-03 and Tomcat 3.2 beta6
> completely separately (no integration at all!) under JDK 1.3
> 
> The following problem appears when I following the
> recommendation
> from jboss "Manual":
> 
> M> jBoss Libraries 
> M>      The following jBoss libraries should be copied to web
> app/WEB-INF/lib:              M>      jboss-client.jar, jnp-client.jar,
> ejb.jar, jta-spec1_0_1.jar
> M> 
> M> JNDI Configuration 
> M>      The jndi.properties files should be copied to web
> app/WEB-INF/classes
> M> 
> M> EJB Client Code 
> M>      The EJB client code should go in web
> app/WEB-INF/classes
> 
> In such configuration I always get the
> NoInitialContextException
> 
> javax.naming.NoInitialContextException: Cannot instantiate
> class: 
>       org.jnp.interfaces.NamingContextFactory.  Root exception is
> java.lang.ClassNotFoundException:
> org.jnp.interfaces.NamingContextFactory
>          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.ClassLoader.loadClassInternal(ClassLoader.java:314)
>          at java.lang.Class.forName0(Native Method)
>          at java.lang.Class.forName(Class.java, Compiled Code)
>          at
> com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java,
> Compiled Code)
>          at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java,
> Compiled Code)
>          at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java,
> Compiled Code)
>          at
> javax.naming.InitialContext.init(InitialContext.java, Compiled
> Code)
>          at
> javax.naming.InitialContext.<init>(InitialContext.java,
> Compiled Code)
>          at
> engas.client.EngasClient.setInitialContext(EngasClient.java,
> Compiled Code)
>          at engas.web.Engas.init(Engas.java, Compiled Code)
>          at
> org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java,
> Compiled Code)
>       [...]
> 
> This problem does NOT occurs when I add all jboss jars and
> jndi.properties
> into Tomcat CLASSPATH.
> 
> Is it Tomcat's problem or mine (wrong DNA or something)?
> 
> My deployment descriptor looks like that:
> 
> ~/Engas/demo0: jar -tf build/engas.war
> WEB-INF/
> WEB-INF/web.xml
> WEB-INF/lib/jboss-client.jar
> WEB-INF/lib/jnp-client.jar
> WEB-INF/lib/ejb.jar
> WEB-INF/lib/jta-spec1_0_1.jar
> WEB-INF/lib/JettyUtil.jar
> WEB-INF/lib/xerces.jar
> WEB-INF/lib/jdom.jar
> WEB-INF/classes/engas/
> WEB-INF/classes/engas/core/
> WEB-INF/classes/engas/core/EngasException.class
> WEB-INF/classes/engas/core/XmlDescriptor.class
> WEB-INF/classes/engas/client/
> WEB-INF/classes/engas/client/EngasCSClient.class
> WEB-INF/classes/engas/client/GenericClient.class
> WEB-INF/classes/engas/client/EngasClient.class
> WEB-INF/classes/engas/web/
> WEB-INF/classes/engas/web/EngasServlet.class
> WEB-INF/classes/engas/web/Engas.class
> WEB-INF/classes/jndi.properties
> META-INF/
> META-INF/MANIFEST.MF
> portal.jsp
> portalErrorPage.jsp
> engasTitle.jsp
> toolbar.jsp
> softcomp.jsp
> software.jsp
> portal1.jsp
> images/
> [...]
> 
> Thanks in advance.
> 
> 
> 
> 
> 

Reply via email to