jar没装。请参见Servlet规范2.3,第9.7.2节。违规类:javax / servlet / Servlet.class [英] jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
问题描述
web.xml
,但是当我启动我的tomcat 7服务器时,我收到以下消息: INFO:validateJarFile(C:\Users\mibvzd0\workspace\.metadata\.plugins\
org.eclipse.wst.server.core\tmp2\\ \\ wtpwebapps\hapi_hl7\WEB-INF\lib\
servlet-api-2.4.jar) - jar没有加载。
请参阅Servlet规范2.3,第9.7.2节。我尝试从webapp / lib中删除servlet,但是,我尝试从webapp / lib中删除servlet,但是这个类似于javax / servlet / Servlet.class
<它没有工作。让我知道在我的情况下应该做什么。
servlet API .jar文件不能嵌入webapp中显然,容器已经在类路径中已经有这些类:它实现了这个jar包中的接口。
依赖关系应该在中提供
范围,而不是默认的编译
范围,在您的Maven pom中:
<依赖性>
< groupId> javax.servlet< / groupId>
< artifactId> javax.servlet-api< / artifactId>
< version> 3.1.0< / version>
< scope>已提供< / scope>
< / dependency>
I am running a Maven project which is also a dynamic web project. I have used all spring libraries in maven. I created web.xml
, but when I start my tomcat 7 server I am getting the following message:
INFO: validateJarFile(C:\Users\mibvzd0\workspace\.metadata\.plugins\
org.eclipse.wst.server.core\tmp2\wtpwebapps\hapi_hl7\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
I tried deleting the servlet from webapp/lib, but it didn't work. Let me know what should be done in my case.
The servlet API .jar file must not be embedded inside the webapp since, obviously, the container already has these classes in its classpath: it implements the interfaces contained in this jar.
The dependency should be in the provided
scope, rather than the default compile
scope, in your Maven pom:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
这篇关于jar没装。请参见Servlet规范2.3,第9.7.2节。违规类:javax / servlet / Servlet.class的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!