The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Pathindex.jsp
解决方法:在pom.xml中添加如下依赖:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
然后保存工程。
问题2:
JAX-RS (REST Web Services) 2.0 requires Java 1.6 or newer
JAX-RS (REST Web Services) 2.0 can not be installed : One or more constraints have not been satisfied
解决方法,在pom.xml的build标签中添加如下:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <!--这句可以不要-->
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding><!--这句可以不要-->
</configuration>
</plugin>
</plugins>
问题3:
maven项目报如下错误:
JavaServer Faces 2.2 can not be installed : One or more constraints have not been satisfied.
JavaServer Faces 2.2 requires Dynamic Web Module 2.5 or newer.mymaven
Cannot change version of project facet Dynamic Web Module to 2.3.
解决方法:修改web.xml文件,将原始文件的
修改为:
然后保存pom.xml文档,右键项目->Maven->Update Project。
另一解决方法:
修改项目中.settings文件夹中的org.eclipse.wst.common.project.facet.core.xml文件,将<installed facet="jst.web" version="3.1"/>这项的version修改为与web.xml中的version值一致的。即图中的两个地方。
然后保存,更新项目。
问题4:
Archive for required library: 'D:/Maven/repository/org/springframework/spring-beans/4.2.0.RELEASE/spring-beans-4.2.0.RELEASE.jar' in project 'movie' cannot be read or is not a valid ZIP file
这应该是jar包损坏了。
解决方法:在http://www.mvnrepository.com/artifact/org.springframework/spring-beans/4.2.0.RELEASE下载新的jai包,然后复制到D:/Maven/repository/org/springframework/spring-beans/4.2.0.RELEASE目录下,替换原来的jar包。然后更新工程。