Tomcat servlet-api.jar问题 [英] Tomcat servlet-api.jar problem

查看:475
本文介绍了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.

这篇关于Tomcat servlet-api.jar问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆