接手别人的项目,从eclipse导入idea,配置好其服务后一直报错,是配置文件初始化步骤不对的原因吗
ERROR [RMI TCP Connection(3)-127.0.0.1] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in ServletContext resource [/WEB-INF/spring-shiro.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in ServletContext resource [/WEB-INF/spring-shiro.xml]: Cannot resolve reference to bean 'usernamePasswordRealm' while setting bean property 'realms' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'usernamePasswordRealm': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taipingpropertyrisk.management.user.dao.UserDao com.taipingpropertyrisk.management.user.realm.UsernamePasswordRealm.userDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taipingpropertyrisk.management.user.dao.mapper.UserMapper com.taipingpropertyrisk.management.user.dao.UserDao.userMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taipingpropertyrisk.management.user.dao.mapper.UserMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-beans.xml]: Invocation of init method failed; nested ex
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
很常见的错误,就是bean没有注入。
太平洋保险:joy:
UserMapper这个bean没找到,No qualifying bean of type [com.taipingpropertyrisk.management.user.dao.mapper.UserMapper]
为啥不用maven?
shiro里面使用了 @Autowired 注入 userDao ,beans.factory找不到这个bean,先顺着shiro里面注入的类往下找有没有缺少注解,再看一下spring全局扫描是否开启了
你好,请仔细查询错误,这都很明显了