org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in file [D:\maven\appach-tomcat\apache-tomcat-8.5.38\wtpwebapps\CIB\WEB-INF\classes\spring\applicationContext-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 file [D:\maven\appach-tomcat\apache-tomcat-8.5.38\wtpwebapps\CIB\WEB-INF\classes\spring\applicationContext-shiro.xml]: Cannot resolve reference to bean 'customRealm' while setting bean property 'realm';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customRealm': Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.CIB.service.SysService com.CIB.shiro.CustomRealm.sysService;
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.CIB.service.SysService] 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)}
整了半天发现自己的service层没有加注解,service层采用的是包扫描方式,因为没加注解就成这样,还以为自己的web.xml中的shiro Fileter过滤器配置错误呢
image.png











网友评论