2014-02-08 40 views
0

我创建Maven项目 “文件 - >新建 - >其他..-> Maven-> Maven项目”
我创建控制器+视图, “Hello World” 的,一切运作良好。
我愚蠢决定点击右击(项目) - > Maven->更新项目(Tomcat的运行状态)。
关于该项目出现“红色感叹号”和“HelloWorld”不起作用。后Spring MVC。 HTTP状态500 - 错误的servlet实例

enter image description here

屏幕 “我的更新”

enter image description here

enter image description here

enter image description here

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.mdosoft</groupId> 
    <artifactId>Primer</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>Primer Maven Webapp</name> 
    <url>http://maven.apache.org</url> 
    <dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-webmvc</artifactId> 
     <version>3.2.6.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>javax.servlet-api</artifactId> 
     <version>3.0.1</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>jstl</artifactId> 
     <version>1.2</version> 
     <scope>provided</scope> 
    </dependency> 
    </dependencies> 
    <build> 
    <finalName>Primer</finalName> 
    </build> 
</project> 
+0

不干净的安装。 –

+1

确保Spring Jar实际存在于您的Tomcat应用程序的WEB-INF中。 – arahant

+0

全新安装 - 没有变化( – DmitMedv

回答

1

运行MVN清洁套装确保所有罐子LIB内夹。如果它不工作变化的servlet API版本2.5

0

你能提供pom.xml文件, 检查servlet api-3.0.1 depaendency范围内,它必须是provided

+0

我添加的pom.xml – DmitMedv

+1

确保所有'jar'文件可用,否则包括所有的依赖。 –

相关问题