*
The moose likes Servlets and the fly likes please help about the error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "please help about the error" Watch "please help about the error" New topic
Author

please help about the error

narasimha rayaprolu
Greenhorn

Joined: Sep 24, 2010
Posts: 1
What is the meaning of this error?

INFO: validateJarFile(C:\Tomcat-5.0.28\webapps\Test\WEB-INF\lib\servlet-api-2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Please help me out.
Soumyajit Hazra
Ranch Hand

Joined: Jun 26, 2007
Posts: 136
The servlet_api.jar is there is in tomcat lib and the container is programmed to fetch it from that location. If you put it in your own application then it throws that exception. It will always look into it's own servlet_api.jar not what you put in your own application lib.


Java Programmer | SCJP 1.5 | SCWCD 1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60745
    
  65

Soumyajit Hazra wrote:The servlet_api.jar is there is in tomcat lib and the container is programmed to fetch it from that location.

Correct, except that the name of the file is servlet-api.jar.

The servlet and JSP jar files should never ever ever, and did I mention ever, be placed in a web app's WEB-INF/lib folder.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Michael Gimm
Greenhorn

Joined: Dec 15, 2009
Posts: 1
Though this was posted in 2002, I hope someone is still watching this despite the non-descript subject line. I am new to the java world and have found myself "thrown" into a webmaster role in which myeclipse was used to develop our website - I did not set this beast up. AT any rate in-line with the original post I understand the issue of Tomcat taking care of suppliying the needed .jar file:

servlet-api-2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

However, based on a reply "The servlet and JSP jar files should never ever ever, and did I mention ever, be placed in a web app's WEB-INF/lib folder" my WEB-INF/lib folder is chaulk full of jar files. Despite this fact and back ttot he original issue - should I just delete the

"servlet-api 2.4.jar" file from my WEB-INF/lib folder and let "servlet-api.jar" in the tomcat/lib folder handle it?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60745
    
  65

Yes.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: please help about the error
 
Similar Threads
Eclipse/Ant: package javax.servlet does not exist
ServletInputStream Class Not found
Unable to complie in JBuilder 7 using ANT
hi servlet jar file
Error to import javax.servlet.*