为了账号安全,请及时绑定邮箱和手机立即绑定

加入shiroFillter之后spring注解失效了

WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in URL [file:/D:/办公软件/Java/apache-tomcat-7.0.82/wtpwebapps/shiro/WEB-INF/classes/spring/spring.xml]: Cannot resolve reference to bean 'securityManagers' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManagers' defined in URL [file:/D:/办公软件/Java/apache-tomcat-7.0.82/wtpwebapps/shiro/WEB-INF/classes/spring/spring.xml]: Cannot resolve reference to bean 'realms' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'realms': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.shiro.dao.UserDao com.shiro.realm.CustomRealm.userDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.shiro.dao.UserDao] 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)}

七月 10, 2018 6:37:17 下午 org.springframework.web.context.ContextLoader initWebApplicationContext

SEVERE: Context initialization failed


正在回答

2 回答

@Component
public class UserDaoImpl implements UserDao{

实现类上加注解了没?

0 回复 有任何疑惑可以回复我~

com.shiro.dao.UserDao注入失败,Spring容器中没有这个bean

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

加入shiroFillter之后spring注解失效了

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号