This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
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
Joined: May 30, 2002
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
sharp shooter, and author
Joined: May 10, 2000
Doh! You do need to have servlets.jar in your CLASSPATH when you compile though. Glad it's working now... Simon