org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping

配置spring+shiro时,启动tomcat报错异常


严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping‘: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.hasAnnotation(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Z

解决办法:

web.xml拦截器异常

如下web.xml 拦截器代码

  1 <servlet>
  2         <servlet-name>DispatcherServlet</servlet-name>
  3         <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  4         <init-param>
  5             <param-name>contextConfigLocation</param-name>
  6             <param-value>classpath:spring/springmvc.xml</param-value>
  7         </init-param>
  8         <load-on-startup>1</load-on-startup>
  9         <async-supported>true</async-supported>
 10     </servlet>
 11     <servlet-mapping>
 12         <servlet-name>DispatcherServlet</servlet-name>
 13         <url-pattern>/</url-pattern>
 14     </servlet-mapping>
 15 

查找后得知:web.xml版本号为2.3 修改版本号为3.0即可

原文地址:https://www.cnblogs.com/xiaohaojs/p/10828058.html

时间: 2024-10-25 13:30:06

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping的相关文章

SSM报错:No converter found for return value of type: class java.util.ArrayList at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverter

我使用的是SSM框架,是在编写测试RESTFUL接口的时候出现, @RequestMapping(value = "/selectAll", method = RequestMethod.GET) @ResponseBody public ResponseEntity<List<User>> selectAll() { List<User> users = this.userService.selectAll(); if (null != users

Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter

严重: StandardWrapper.Throwableorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping': Invocation of init method failed; nested excepti

org.springframework.web.servlet.PageNotFound

2017-07-11 16:36:13.489 WARN [http-nio-8032-exec-16]org.springframework.web.servlet.PageNotFound -Request method 'POST' not supported 2017-07-11 16:37:30.491 WARN [http-nio-8032-exec-48]org.springframework.web.servlet.PageNotFound -Request method 'PO

org.springframework.web.HttpRequestMethodNotSupportedException: Request method &#39;PUT&#39; not supported

1:先上控制台报错信息 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'PUT' not supported

【Feign调用异常】org.springframework.web.HttpRequestMethodNotSupportedException: Request method &#39;GET&#39; not supported

一.异常场景描述 明明是post请求,为啥到达服务器后就变成了get请求 2019-05-30 18:07:17.055 [http-nio-10650-exec-4] ERROR c.x.xcauto.common.controller.BaseControllerAdvice - 检测到未捕捉异常:IP:192.168.128.1 invoke url:http://172.17.244.170:10650/stock/valid/num/v1 Exception:public class

org.springframework.web.servlet.DispatcherServlet--Spring的前置控制器简介

Struts有一个ActionServlet,用来完成前置控制器(分发器)的功能.其实,所有MVC框架都有一个Servlet来完成这个功能,Spring也不例外,Spring中的前置控制器(分发器)就是DispatcherServlet. 在百度百科这样介绍它的作用: DispatcherServlet是前置控制器,配置在web.xml文件中的.拦截匹配的请求,Servlet拦截匹配规则要自已定义,把拦截下来的请求,依据相应的规则分发到目标Controller来处理,是配置spring MVC的

[org.springframework.web.servlet.PageNotFound] -No mapping found for HTTP request with URI [/homework/js/jquery-1.7.2.min.js] in DispatcherServlet with name &#39;SpringMVC&#39;

先上解决方案:对于上面出现的问题,查看了很多相关的博客,论坛.最后实在Spring-mvc.xml这个配置文件里加入了如下两行: 1 <mvc:annotation-driven /> 2 <mvc:default-servlet-handler /> 问题描述: 由于项目需要Ajax,于是在jsp的head里加入了如下代码: 1 <script type="text/javascript" src="/homework/js/jquery-1.

org.springframework.web.servlet.view.InternalResourceViewResolver

http://blog.csdn.net/superdog007/article/details/28857495 我们在controller里面经常这样return一个ModelAndView: return new ModelAndView('user', 'model', model); DispatcherServlet靠ViewResolver把user解析为/WEB-INF/jsp/user.jsp: 常用的ViewResolver: InternalResourceViewReso

org.springframework.web.servlet.DispatcherServlet报错

搭建springmvc时,出现org.springframework.web.servlet.DispatcherServlet错误.检查了MAVEN依赖,包已下载好了,但就是找不到-- java.lang.ClassNotFoundException 重新检查项目的 web deployment assembly ,发现没有将maven依赖加入到其中,重新将其中所有的jar包加入.重启Tomcat.报错解决.