第一次学习并整合shiro框架,遇到的错误记载下
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'shiroFilter' defined in class path resource [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 class path resource [applicationContext-shiro.xml]:
Cannot resolve reference to bean 'databaseRealm' while setting bean property 'realm';
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'databaseRealm': Unsatisfied dependency expressed through field 'permissionService';
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type 'com.mqb.service.PermissionService' available:
expected at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{@org.springframework.beans.factory.annotation.Autowired(required=true)}
这次是因为permissionService没有注入,忘记加@Service