Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat 4.1.18 - servlet.jar not loaded

 
Rich Smyth
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm running on MS XP. On startup of tomcat 4.1.18 I get a message saying that servlet.jar can't be loaded because of the Servlet spec 2.3 section 9.7.2 (included below).
I'm new to tomcat and I'm not too familiar with classloaders.
The message from the console at startup of Tomcat 4.1.18 says:
"WebAppClassLoader: validateJarFile<C:\jakarta\jakarta-tomcat-4.1.18\
webapps\registeruser\WEB-INF\lib\servlet.jar> jar not loaded. See Servlet spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class"
The reference to registeruser is my struts webapp.
The servlet spec 2.3 section 9.7.2 says:
SRV.9.7.2 Web Application Classloader
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.
What does this mean?
Rick
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a brand new installation or did you have an earlier version of Tomcat running?
Bill
 
Rich Smyth
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a new installation of Tomcat. I'm trying to setup a Struts development environment on a brand new machine.
Rich
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you place a copy of servlet.jar inside your web application (inside WEB-INF/lib)? You usually get this error message when you do this because you're not allowed to (re)load these classes - after all they are already provided by the container.
Simon
 
Rich Smyth
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Simon. I did indeed have servlet.jar included in my webapp. Tomcat now starts up clean.
I'm working through 2 examples on how to create a webapp using struts and both of them said to include servlet.jar. Remains to be seen if these examples will now work !?
Rich
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doh! You do need to have servlets.jar in your CLASSPATH when you compile though.
Glad it's working now...
Simon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic