You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Will Hartung <wi...@msoft.com> on 2002/12/12 02:05:44 UTC

Tomcat 4.1.12, Weblogic, and Classloaders -- Oh my!

Okay, I've bumbled through and got most of my issue figured out.

However, now I'm back where I started at the very beginning, but now I have
a better understanding of why things are where.

Anyway, better living through stack dumps, so here we go:

2002-12-11 16:35:03 StandardManager[/eCMS]: Seeding random number generator
class java.security.SecureRandom
2002-12-11 16:35:03 StandardManager[/eCMS]: Seeding of random number
generator has been completed
2002-12-11 16:35:03 StandardWrapper[/eCMS:default]: Loading container
servlet default
2002-12-11 16:35:03 StandardWrapper[/eCMS:invoker]: Loading container
servlet invoker
2002-12-11 16:35:04 StandardWrapper[/eCMS:action]: Marking servlet action as
unavailable
2002-12-11 16:35:04 StandardContext[/eCMS]: Servlet /eCMS threw load()
exception
javax.servlet.ServletException: Error instantiating servlet class
com.pfizer.ecms.ws.ECMSActionServlet
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:90
1)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3341)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
21)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
(etc...)

Which has as "root cause":

----- Root Cause -----
java.lang.NoClassDefFoundError: javax/ejb/EJBObject
 at java.lang.Class.newInstance0(Native Method)
 at java.lang.Class.newInstance(Class.java:237)
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:89
2)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3341)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
21)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

Now, this is all fine and peachy save that in my WEB-INF/lib of my webapp, I
have the file weblogicaux.jar.

Within THAT file is the javax/ejb/EJBObject

I find that because of the interdependencies of the weblogic stuff and it's
use of reflection, you can not have the EJB jars at a different level than
everything else. So, all of my relevant jars on in the WEB-INF/lib
directory.

The only external jar is log4j, which is in shared/lib.

So, I'm REALLY curious as to why perhaps my app can not SEE
javax/ejb/EJBObject.

There is no other javax/ejb/EJBObject that I can find.

Any hints would be much appreciated.

Regards,

Will Hartung
(willh@msoft.com)

When I first started this proc




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat 4.1.12, Weblogic, and Classloaders -- Oh my!

Posted by Jacob Kjome <ho...@visi.com>.
I'm not completely clear on what you are doing.  You're are running 
Weblogic specific stuff inside Tomcat?  I don't quite get it.  However, the 
classloading issue is probably caused by a class outside WEB-INF/lib (in a 
parent classloader) trying to reference javax.ejb.EJBObject.  The only way 
it could do this is to load it via the thread context classloader.  Loading 
it via Class.forName() or getClass().getClassloader().loadClass() won't cut 
it here.  Either your EJB stuff needs to be in the parent classloader so 
whatever is trying to instantiate it can find it, or you need for the class 
that is instantiating it to load EJBObject via:

Thread.currentThread().getContextClassLoader().loadClass()

remember that WEB-INF/lib can see the parent classloaders (shared/lib, 
common/lib, and common/endorsed) but not vice-versa unless you use the 
thread context classloader.  This is a major problem with a lot of 
libraries out there who use the old Class.forName() which only works within 
the current classloader and can't even see parent classloaders.  There is 
another version of Class.forName() where you can specify the classloader 
which you can set as getClass().getClassLoader(), but that still doesn't 
see child classloaders, only parents.

Jake

At 05:05 PM 12/11/2002 -0800, you wrote:
>Okay, I've bumbled through and got most of my issue figured out.
>
>However, now I'm back where I started at the very beginning, but now I have
>a better understanding of why things are where.
>
>Anyway, better living through stack dumps, so here we go:
>
>2002-12-11 16:35:03 StandardManager[/eCMS]: Seeding random number generator
>class java.security.SecureRandom
>2002-12-11 16:35:03 StandardManager[/eCMS]: Seeding of random number
>generator has been completed
>2002-12-11 16:35:03 StandardWrapper[/eCMS:default]: Loading container
>servlet default
>2002-12-11 16:35:03 StandardWrapper[/eCMS:invoker]: Loading container
>servlet invoker
>2002-12-11 16:35:04 StandardWrapper[/eCMS:action]: Marking servlet action as
>unavailable
>2002-12-11 16:35:04 StandardContext[/eCMS]: Servlet /eCMS threw load()
>exception
>javax.servlet.ServletException: Error instantiating servlet class
>com.pfizer.ecms.ws.ECMSActionServlet
>  at
>org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:90
>1)
>  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
>  at
>org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
>3341)
>  at
>org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
>  at
>org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
>21)
>  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
>(etc...)
>
>Which has as "root cause":
>
>----- Root Cause -----
>java.lang.NoClassDefFoundError: javax/ejb/EJBObject
>  at java.lang.Class.newInstance0(Native Method)
>  at java.lang.Class.newInstance(Class.java:237)
>  at
>org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:89
>2)
>  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
>  at
>org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
>3341)
>  at
>org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
>  at
>org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
>21)
>  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
>
>Now, this is all fine and peachy save that in my WEB-INF/lib of my webapp, I
>have the file weblogicaux.jar.
>
>Within THAT file is the javax/ejb/EJBObject
>
>I find that because of the interdependencies of the weblogic stuff and it's
>use of reflection, you can not have the EJB jars at a different level than
>everything else. So, all of my relevant jars on in the WEB-INF/lib
>directory.
>
>The only external jar is log4j, which is in shared/lib.
>
>So, I'm REALLY curious as to why perhaps my app can not SEE
>javax/ejb/EJBObject.
>
>There is no other javax/ejb/EJBObject that I can find.
>
>Any hints would be much appreciated.
>
>Regards,
>
>Will Hartung
>(willh@msoft.com)
>
>When I first started this proc
>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>