-
1. Re: jboss-3.2.1_tomcat-4.1.24 Servlet to Local Session EJB s
adrian.brock Aug 4, 2003 1:43 PM (in response to rcostanzo)Sounds like you have a jndi.properties somewhere in the
deployment?
Regards,
Adrian -
2. Re: jboss-3.2.1_tomcat-4.1.24 Servlet to Local Session EJB s
rcostanzo Aug 4, 2003 1:54 PM (in response to rcostanzo)My jndi.properties is the default. I've tracked down the exception through the source code and what's happening is as follows:
The local naming class variable, which gets set when the jnp service is started through the method NamingContext.setLocal, is null for some reason. This is causing the NamingContext to do a broadcast to search for the server to do the lookup on. This is what is timing out.
I believe that for some reason it is not finding its local jnp instance which is supposed to be defined when the jnp server starts up (which is happening properly I verified in my log file). I need to find out why that variable is not being set. My best guess now is that the class is available in multiple classloaders and the wrong one is being accessed. I'm going to see if any other NamingContext classes are available in any of the jars included in my WAR. -
3. Re: jboss-3.2.1_tomcat-4.1.24 Servlet to Local Session EJB s
rcostanzo Aug 4, 2003 3:05 PM (in response to rcostanzo)Here's what I've found:
When the local server gets set in the Naming Context (a static method call), if I print out the classloader it's the UnifiedClassLoader.
However, when I go to access the local homes and it's in the lookup method, the local server is null and the classloader is the WebappClassLoader.
What's odd is I checked all of the jars under my server directory and the only jar which contains the NamingContext class is in server/default/lib/jnpserver.jar
So is there anything obviously wrong with my EAR that would cause Tomcat to be using its own classloader and "copy into it" a class from the UnifiedClassLoader? Also, the parent of the WebAppClassLoader is java.net.FactoryURLClassLoader and NOT the UnifiedClassLoader as I would expect. -
4. Re: jboss-3.2.1_tomcat-4.1.24 Servlet to Local Session EJB s
rcostanzo Aug 4, 2003 5:17 PM (in response to rcostanzo)I printed out all of the classloader info I could get using the nice debug util included in the jboss examples. When not accessing EJBs through Tomcat the NamingContext class's loader details looks like:
[java] org.jnp.interfaces.NamingContext(10bbf9e).ClassLoader=org.jboss.mx.loading.Unif
iedClassLoader3@12611a7{ url=file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/tmp/deploy/
server/default/conf/jboss-service.xml/1.jboss-service.xml ,addedOrder=2}
[java] ..org.jboss.mx.loading.UnifiedClassLoader3@12611a7{ url=file:/C:/jboss-3.2.1_to
mcat-4.1.24/server/default/tmp/deploy/server/default/conf/jboss-service.xml/1.jboss-servic
e.xml ,addedOrder=2}
[java] ..org.jboss.system.server.NoAnnotationURLClassLoader@e53108
[java] ..sun.misc.Launcher$AppClassLoader@12f6684
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/bin/run.jar
[java] ....file:/C:/j2sdk1.4.1_03/lib/tools.jar
[java] ..sun.misc.Launcher$ExtClassLoader@f38798
[java] ....file:/C:/j2sdk1.4.1_03/jre/lib/ext/dnsns.jar
[java] ....file:/C:/j2sdk1.4.1_03/jre/lib/ext/ldapsec.jar
[java] ....file:/C:/j2sdk1.4.1_03/jre/lib/ext/localedata.jar
[java] ....file:/C:/j2sdk1.4.1_03/jre/lib/ext/sunjce_provider.jar
[java] ++++CodeSource: (file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/lib/jnpserve
r.jar <no certificates>)
[java] Implemented Interfaces:
[java] ++interface javax.naming.Context(513d61)
[java] ++++ClassLoader: null
[java] ++++Null CodeSource
[java] ++interface java.io.Serializable(19e8329)
[java] ++++ClassLoader: null
[java] ++++Null CodeSource
When accessing it (indirectly) through Tomcat by looking up the local home, it looks like:
[java] org.jnp.interfaces.NamingContext(4e18d4).ClassLoader=WebappClassLoader
[java] available:
[java] Extension[javax.activation, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.0.2, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.0]
[java] Extension[org.apache.commons.beanutils, implementationVendor=Apache Software Foundation, implementationVersion=1.4-dev, specificationVendor=Apache Software Foundation, specificationVersion=1.0]
[java] Extension[org.apache.commons.collections, implementationVendor=Apache Software Foundation, implementationVersion=2.1, specificationVendor=Apache Software Foundation,
specificationVersion=2.1]
[java] Extension[org.apache.commons.digester, implementationVendor=Apache Software Foundation, implementationVersion=1.3, specificationVendor=Apache Software Foundation, specificationVersion=1.0]
[java] Extension[org.apache.commons.validator, implementationVendor=Apache Software Foundation, implementationVersion=1.0.1, specificationVendor=Apache Software Foundation, specificationVersion=1.0]
[java] Extension[Struts Framework, implementationVendor=Apache Software Foundation, implementationVendorId=org.apache, implementationVersion=1.1, specificationVendor=Apache Software Foundation, specificationVersion=1.1]
[java] delegate: false
[java] repositories:
[java] /WEB-INF/classes/
[java] required:
[java] ----------> Parent Classloader:
[java] java.net.FactoryURLClassLoader@13c6a8b
[java]
[java] ..WebappClassLoader
[java] available:
[java] Extension[javax.activation, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.0.2, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.0]
[java] Extension[org.apache.commons.beanutils, implementationVendor=Apache Software Foundation, implementationVersion=1.4-dev, specificationVendor=Apache Software Foundation, specificationVersion=1.0]
[java] Extension[org.apache.commons.collections, implementationVendor=Apache Software Foundation, implementationVersion=2.1, specificationVendor=Apache Software Foundation, specificationVersion=2.1]
[java] Extension[org.apache.commons.digester, implementationVendor=Apache Software Foundation, implementationVersion=1.3, specificationVendor=Apache Software Foundation, specificationVersion=1.0]
[java] Extension[org.apache.commons.validator, implementationVendor=Apache Software Foundation, implementationVersion=1.0.1, specificationVendor=Apache Software Foundation, specificationVersion=1.0]
[java] Extension[Struts Framework, implementationVendor=Apache Software Foundation, implementationVendorId=org.apache, implementationVersion=1.1, specificationVendor=Apache Software Foundation, specificationVersion=1.1]
[java] delegate: false
[java] repositories:
[java] /WEB-INF/classes/
[java] required:
[java] ----------> Parent Classloader:
[java] java.net.FactoryURLClassLoader@13c6a8b
[java]
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/tmp/deploy/server/default/deploy/work/MainEngine/localhost/psp/WEB-INF/classes/
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/tmp/deploy/server/default/deploy/work/MainEngine/localhost/psp/WEB-INF/lib/BlowfishJ-2.0.2.jar
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/tmp/deploy/server/default/deploy/work/MainEngine/localhost/psp/WEB-INF/lib/PSP-V2-COMMON-CURRENT.jar
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/tmp/deploy/server/default/deploy/work/MainEngine/localhost/psp/WEB-INF/lib/PSP-V2-DATAPASS-CURRENT.jar
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/tmp/deploy/server/default/deploy/work/MainEngine/localhost/psp/WEB-INF/lib/activation-1.0.2.jar
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/tmp/deploy/server/default/deploy/mail-service.xml/33.mail-service.xml
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/lib/jboss-jsr77.jar
[java] ....file:/C:/j2sdk1.4.1_03/jre/lib/ext/localedata.jar
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/jbossweb-tomcat.sa
r/
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/lib/jboss-jaas.jar
[java] ..java.net.FactoryURLClassLoader@13c6a8b
[java] ..org.jboss.mx.loading.UnifiedClassLoader3@1a1ff9{ url=file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/PSP.ear/ ,addedOrder=24}
[java] ..org.jboss.mx.loading.HeirarchicalLoaderRepository3$NoParentClassLoader@8d1800
[java] ..sun.misc.Launcher$AppClassLoader@12f6684
[java] ....file:/C:/jboss-3.2.1_tomcat-4.1.24/bin/run.jar
[java] ....file:/C:/j2sdk1.4.1_03/lib/tools.jar
[java] ..sun.misc.Launcher$ExtClassLoader@f38798
[java] ....file:/C:/j2sdk1.4.1_03/jre/lib/ext/dnsns.jar
[java] ....file:/C:/j2sdk1.4.1_03/jre/lib/ext/ldapsec.jar
[java] ....file:/C:/j2sdk1.4.1_03/jre/lib/ext/localedata.jar
[java] ....file:/C:/j2sdk1.4.1_03/jre/lib/ext/sunjce_provider.jar
[java] ++++CodeSource: (file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/lib/jnpserve
r.jar <no certificates>)
[java] Implemented Interfaces:
[java] ++interface javax.naming.Context(513d61)
[java] ++++ClassLoader: null
[java] ++++Null CodeSource
[java] ++interface java.io.Serializable(19e8329)
[java] ++++ClassLoader: null
[java] ++++Null CodeSource
[java] 18:03:29,135 ERROR [STDERR]
So when going through Tomcat's classloader it has EVERYTHING in it. When not it's very clean. Another interesting note is when I switch back to Jetty, the classloader info looked exactly like the first one even when accessing it through the webapp. Does Jetty not create a child WebAppClassLoader like Tomcat?
Hopefully somebody has seen something like this before and can make some sense of it for me. Thanks.