加入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
2018-07-22
實(shí)現(xiàn)類上加注解了沒(méi)?
2018-07-18
com.shiro.dao.UserDao注入失敗,Spring容器中沒(méi)有這個(gè)bean