猿问

mvc一加拦截器的配置就报错

警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#0': Cannot create inner bean 'controller.interceptor#0' of type [controller.interceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [controller.interceptor] for bean with name 'controller.interceptor#0' defined in class path resource [mvc.xml]; nested exception is java.lang.ClassNotFoundException: controller.interceptor

六月 16, 2018 11:06:57 上午 org.springframework.web.servlet.DispatcherServlet initServletBean

严重: Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#0': Cannot create inner bean 'controller.interceptor#0' of type [controller.interceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [controller.interceptor] for bean with name 'controller.interceptor#0' defined in class path resource [mvc.xml]; nested exception is java.lang.ClassNotFoundException: controller.interceptor

不加拦截器配置可以正常显示,不报错,初学spring mvc上网找了好多都无法解决,环境换了好几个版本依然不行,

慕粉1145407289
浏览 1328回答 1
1回答

wldraa

nested exception is java.lang.ClassNotFoundException: controller.interceptorcontroller.interceptor 没有找到这个类 ,你检查一下是包名没有打全,还是拼错了 (比如 i 是大写的?)
随时随地看视频慕课网APP

相关分类

Java
我要回答