关于NoSuchBeanDefinitionException: No bean named 'xxxx' is defined问题解决
2018-03-28 14:56
405 查看
问题如下:DEBUG - Retrieved dependent beans for bean '(inner bean)': [org.springframework.web.servlet.handler.MappedInterceptor#0]
ERROR - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#1' defined in class path resource [springmvc.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'UserController' is defined
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:532)
解决方案:少spring的jar包。pom.xml中添加
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
</dependency>
问题即可解决。
ERROR - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#1' defined in class path resource [springmvc.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'UserController' is defined
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:532)
解决方案:少spring的jar包。pom.xml中添加
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
</dependency>
问题即可解决。
相关文章推荐
- 关于NoSuchBeanDefinitionException: No bean named 'xxxx' is defined问题解决
- 关于NoSuchBeanDefinitionException: No bean named 'xxxx' is defined问题解决
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'XXXX' is defined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cxf' is defined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xx' is defined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xx' is defined
- 解决:spring报错:.NoSuchBeanDefinitionException: No bean named 'bussinessLogicRpc' is defined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' 错误解决办法
- “NoSuchBeanDefinitionException: No qualifying bean of type”问题解决
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xx' is defined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xx' is defined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xx' is defined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xx' is defined
- FAQ(36):org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'userService'
- 关于MyBatis和Spring整合时,No bean named 'xxx' is defined我遇到的问题
- org.springframework.beans.factory.NoSuchBeanDefinitionException:No bean named 'testAction' is define
- FAQ(20):org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'zhangga' is
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'userService' availab
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' availab
- No bean named 'MysessionFactory' is defined问题的解决