The referenced section:

The classloader that a container uses to load a servlet in a WAR must allow the
developer to load any resources contained in library JARs within the WAR
following normal J2SE semantics using getResource. It must not allow theWAR to
override J2SE or Java servlet API classes. It is further recommended that the loader
not allow servlets in theWAR access to the web container’s implementation classes.
It is recommended also that the application class loader be implemented so
that classes and resources packaged within the WAR are loaded in preference to
classes and resources residing in container-wide library JARs.


So it sounds like your container is unhappy because you're trying to override servlet api classes. And it sounds like you won't get any farther by unzipping in your webapp's lib dir. i bet somewhere in common or server is the way to go, but it looks like you're already tried that to no avail. so i dunno.

Michael Oliver wrote:
Ok, that helped too.

I tried moving the j2ee.jar that contains the
javax.xml.rpc.ServiceException I need to the tomcat /common/
directories, /endorsed and /lib

When in the /endorsed the j2ee.jar showed in the logs as [opened],
however there was a NoClassDefFoundError for the
/com/sun/jmx/mbeanserver/GetPropertyAction and Tomcat didn't start.

So I moved j2ee.jar to /lib and got the same NoClassDefFoundError and
Tomcat didn't start.

So I moved j2ee.jar back to the Webapp /lib and restarted with my
JAVA_OPTS = "-verbose" and AHHA!

I find this in the logs:

Webapp Class Loader:
validateJarFile(/root/java/jakarta-tomcat-4.1.29/webapps/AJCS/WEB-INF/li
b/j2ee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2.
Offending class: javax/servlet/Servlet.class


Webapp Class Loader:
validateJarFile(/root/java/jakarta-tomcat-4.1.29/webapps/AJCS/WEB-INF/li
b/servlet-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section
9.7.2. Offending class: javax/servlet/Servlet.class

I am guessing the solution would be to unpack the jar into the
WEB-INF/classes/ directory so the individual classes needed can be
loaded without validateJarFile.  Or is there another way?

Michael Oliver
CTO
Matrix Intermedia Inc.
3325 N. Nellis Blvd, #1
Las Vegas, NV 89115
Phone:(702)643-7425
Fax:(520)844-1036

-----Original Message-----
From: Andrew Huntwork [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 8:37 AM
To: [EMAIL PROTECTED]
Subject: Re: [jug-discussion] classDefNotFound


the -verbose command line arg to sun's jvm shows you what jars are being

loaded and what classes from each jar are loaded. the same flag to bea's jvm (distributed with redhat el 3) causes an excrutiatingly verbose log. I guess you could give that a try.

Michael Oliver wrote:

I know this august group can help.



I am befuddled (not unusual) because I have a class that runs fine in

my


JUnit test within Eclipse but when I deploy it to my Tomcat

application


it throws a lang.classDefNotFound exception. I know that the

classpath


in Eclipse (that works) and the jars in that classpath need to be in

the


Tomcat classpath and I have gone jar by jar through those in the

Eclipse


classpath and the Tomcat Web-Inf/lib/ for my WebApp, yet when I try to


instantiate my class it throws the exception.



There are more jars in the Tomcat classpath than are in my Eclipse project classpath, but the class it can't find is javax.xml.rpc.ServiceException and that is in the j2ee.jar and I have verified it is the same in both paths.



Anyone think of anything else I can try?



Michael Oliver

CTO

Matrix Intermedia Inc.

3325 N. Nellis Blvd, #1

Las Vegas, NV 89115

Phone:(702)643-7425

Fax:(520)844-1036





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to