【发布时间】:2015-11-09 12:17:39
【问题描述】:
我阅读了大量与此问题相关的帖子,但没有得到任何帮助。
错误 感谢是否有人可以帮助我。
这就是我的 POM 和 web 的样子。我尝试将所需的战争文件复制到 C:\appache tomcat 7 但没有运气。即使在 eclipse 中部署它也会给我同样的错误。
网络 enter image description here
POM.xml:-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tutorialacademy.rest</groupId>
<artifactId>helloworld</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>helloworld Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-apache-client</artifactId>
<version>1.19</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
【问题讨论】:
-
图像是一样的...无论如何,不要发布错误或代码的图像。编辑您的问题,将错误消息和代码作为格式正确的文本添加。
-
我可以在图像中看到您使用的是 Apache Tomcat 7.0.x。我还可以看到您有一个 web.xml 将 Servlet API 声明为 3.1。请注意,Tomcat 7.0.x 支持 Servlet API 3.0。更多信息在Apache Tomcat documentation。
-
看看我更新的答案。
标签: eclipse rest tomcat jersey restful-url