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
<p><img height="44" src="https://oscimg.oschina.net/oscnet/up-45b18ea476deb33b6d11fc8851c282af852.png" width="729"><br> 你好,请仔细查询错误,这都很明显了</p>
<p>shiro里面使用了 @Autowired 注入 userDao ,beans.factory找不到这个bean,先顺着shiro里面注入的类往下找有没有缺少注解,再看一下spring全局扫描是否开启了</p>
<p>为啥不用maven?</p>
<p>UserMapper这个bean没找到,No qualifying bean of type [com.taipingpropertyrisk.management.user.dao.mapper.UserMapper]</p>
太平洋保险:joy:
<p>很常见的错误,就是bean没有注入。</p>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。