org.springframework.beans.factory.BeanCreationException

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#2': Cannot create inner bean 'org.springframework.web.servlet.HandlerInterceptor#0' of type [org.springframework.web.servlet.HandlerInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.HandlerInterceptor#0' defined in class path resource [springmvc.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerInterceptor]: Specified class is an interface
	

查询之后发现是因为springmvc设置的拦截器的拦截方式clsaa后面跟的是一个接口

	

把接口改成实现类的地址问题就解决了

    


出现 java.lang.ClassNotFoundException

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#2': Cannot create inner bean 'cn.itcast.springall.Intercepto.MyInterceptor#0' of type [cn.itcast.springall.Intercepto.MyInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [cn.itcast.springall.Intercepto.MyInterceptor] for bean with name 'cn.itcast.springall.Intercepto.MyInterceptor#0' defined in class path resource [springmvc.xml]; nested exception is java.lang.ClassNotFoundException: cn.itcast.springall.Intercepto.MyInterceptor

查询后发现和上面的问题类似

因为springmvc设置的拦截器的拦截方式clsaa后面跟的地址不对

修改class后面的地址就可以了

你可能感兴趣的:(org.springframework.beans.factory.BeanCreationException)