This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Hi fellow ranchers. I'm having this problem with Tomcat 4.1.18 refusing to load up the sevlet.jar file at server start-up. I put the file in the lib directory of the web application as I've done always. I've even swapped different versions of the servlet.jar file but Tomcat simply rejects it. Here is what gets printed out on the standard output (DOS Window) when I start Tomcat: Feb 15, 2003 11:55:04 PM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Feb 15, 2003 11:55:04 PM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Feb 15, 2003 11:55:05 PM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Feb 15, 2003 11:55:07 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18 WebappClassLoader: validateJarFile(C:\Ernie's Data\JSP\PROJECTS\ernieboy\WEB-INF \lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offendi ng class: javax/servlet/Servlet.class Feb 15, 2003 11:55:16 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 Feb 15, 2003 11:55:16 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Feb 15, 2003 11:55:16 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=10/60 config=C:\user_data\Tomcat 4118WinXp\conf\jk2. properties
Please look at lines 11-14 of the output. When i read the mentioned Servlet 2.3 section I'm still none the wiser. Please shed some light. I'm on a Windows XP Pro box.
In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
I've looked up 9.7.2 and here is the relevant part:
It (the classloader; that is, the container) must not allow the WAR to override J2SE or Java servlet API classes. It is further recommended that the loader not allow servlets in the WAR access to the web container�s implementation classes.
So by trying to load servlet.jar within your webapp, you are trying to override the Java servlet API classes, which is forbidden in the spec.
Joined: Aug 27, 2001
Thank you very much Mike. I will try and run my servlets without loading the servlet.jar file. In any case, there is already a servlet.jar file which comes with Tomcat 4.1.18 and it's under TOMCAT_HOME\common\lib and I guess this is the file I'm overriding when loading my own file in my web app.