Tomcat servlet-api.jar问题

问题描述:

我正在使用Tomcat和Java Servlet,JSP等运行Web应用程序.

I am running a web application using Tomcat and Java Servlets, JSP's, etc.

我知道,要使用Servlet,它取决于Servlet-api.jar文件.最初,我将此jar文件放在

I am aware that in order to use Servlets, it is dependent on the Servlet-api.jar file. Initially I placed this jar file in the

WEB-INF/lib/

目录中.

在开发阶段,这对我来说已经工作了好几个月了.

This has worked fine for me for months during the developmental phase.

将应用程序放到我们正在使用的服务器空间上时,我们开始看到Catalina.out文件中出现了一些奇怪的问题,告诉我们 servlet-api.jar 存在依赖关系问题文件.

When we put the application onto the server space we are using, we started seeing wierd problems showing up in the Catalina.out file telling us that there was dependency problems with the servlet-api.jar file.

我知道tomcat的容器中有这个jar文件,我应该将它从

I am aware that tomcat has this jar file in its container, and that I should remove it from the

WEB-INF/lib/

目录中删除.我已经尝试过了,但是行不通.

directory. I have tried this and it does not work.

当我从本地文件中删除此jar文件并使它依赖于tomcats servlet-api.jar文件时,我该怎么办.

What do I have to do when I remove this jar file from the local files and allow it to depend on tomcats servlet-api.jar file.

这是从我收到的Catalina.out文件中提取的确切消息.我将外部JAR添加到类路径中,并且可以正常工作,但是我收到了这个问题.

This is the exact message pulled from my Catalina.out file that I have been receiving. I added the external JAR to the class path, and It worked, but I am receiving this problem.

May 17, 2010 12:33:31 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/home/weremo/appservers/apache-tomcat-6.0.26/webapps/WMA-Test/WEB-
INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2.
Offending class: javax/servlet/Servlet.class

Servlet-api.jar由容器环境默认提供.因此,在部署应用程序时,请勿将其放在WEB-INF/LIB文件夹中.但是,编译Servlet是必需的.如果您使用Eclipse作为IDE,请使用添加外部JAR文件"选项将其放置在类路径中.

Servlet-api.jar is by default provided by the container environment. So you should not put it in your WEB-INF/LIB folder when you are deploying your application. However, it is required for compiling your Servlets. In case if you are using Eclipse as your IDE, place it in your classpath using Add External JAR files option.