Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts with tomcat -not recognizing servlet.api.jar

 
aditya chowdary
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi evereyBody,
I am trying to run struts application in tomcat5.0.19.I am getting the fallowing exception while running tomcat.Please give me solution regd this.
i have tested with the tomcat servlet-api.jar(5.0).

INFO: Installing web application at context path /exercise04 from URL file:C:\jakarta-tomcat-5.0.19\webapps\Myapp
Aug 2, 2005 7:08:09 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\jakarta-tomcat-5.0.19\webapps\Myapp\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Aug 2, 2005 7:08:09 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Aug 2, 2005 7:08:09 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Aug 2, 2005 7:08:09 PM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
Thnx...
 
Pavan Tummala
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set Servlet-api.jar in ur classpath
 
aditya chowdary
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sorry again,

I have set the classpath also.the classpath is like

C:\jakarta-tomcat-5.0.19\common\lib\servlet-api.jar;
C:\jakarta-tomcat-5.0.19\common\lib\jsp-api.jar;
C:\jakarta-tomcat-5.0.19\common\lib\struts.jar;
C:\jakarta-tomcat-5.0.19\common\lib\commons-validator;.;

I guess the problem is mismatch of servlet.jar file versions.i took latest jar file (from tomcat5.0)but still........
 
Stefan Evans
Bartender
Posts: 1691
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>INFO: validateJarFile
>C:\jakarta-tomcat-5.0.19\webapps\Myapp\WEB-INF\lib\servlet-api.jar

You shouldn't have servlet-api.jar in your web-inf/lib directory.

Also note that Tomcat does not use the classpath environment variable.
The classpath (as far as Tomcat is concerned is)
Class folder: web-inf/classes
Jar files in: web-inf/lib, [TOMCAT]/shared/lib, [TOMCAT]/common/lib

If a jar file appears more than once in these various directories it can create a problem.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic