一、问题分析
1.web.xml文件 web应用部署描述符,里面的部署的xml文件或者类,如果这些找不到就会发生startup failed due to previous errors错误。
2.如果在应用spring的话,在配置文件applicationContext.xml中定义的类、xml文件找不到也会报这个错误。
3.在web.xml,struts.xml,applicationContext.xml文件中自身有任何一点错误都可能引起上面的这个问题,而不仅仅是附带的文件错误导致。
<!--在struts.xml添加,出现异常时,友好的提示-->
<constant name="struts.devMode" value="true"></constant>
4.如果使用ibatis的话,在SqlMapConfig.xml中定义的xml文件找不到也会报这个错误。(hibernate的配置在整合spring的时候使用spring的配置文件)
5.JDK的版本问题,最好使用JDK5.0 或者更高的版本。
6.Eclipse和tomcat的版本兼容问题
7.框架整合的过程中在导入到lib下的jar包冲突也可能产生该错误。
8.jar包的缺少以及jar包的版本也可产生该错误。
9.其他
链接: 相关博客
二、我的报错
三、解决方式
报错的极大可能是jar包的冲突: 展示 pom.xml
,我的解决方式
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
效果展示