页面错误展示:
HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
type Exception report
message Servlet.init() for servlet springmvc threw exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception
root cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'simpleUrlHandlerMapping' defined in ServletContext resource [/WEB-INF/springmvc-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.web.servlet.handler.AbstractHandlerMapping.obtainApplicationContext()Lorg/springframework/context/ApplicationContext;
错误原因可能情况:
spring-webmvc与org.springframework.context两个jar包的版本冲突,可以使用如下的版本解决
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.1.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.context</artifactId>
<version>3.2.2.RELEASE</version>
</dependency>