整合shiro之前程序正常启动,数据库也可以查到,但是整合完之后出现问题,一直报以下的错,说shirofilter有问题,求大佬解决一下
**
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘shiroFilter’ defined in class path resource [applicationContext.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.xml]: Cannot resolve reference to bean ‘shiroRealm’ while setting bean property ‘realm’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘shiroRealm’: Unsatisfied dependency expressed through field ‘loginService’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.xtd.shiro.login.service.LoginService’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
**
请教完别人以后查了资料,重新写了一个项目,问题解决了,自己分析可能是在*Mapper.xml中,返回类型没有写全路径的问题
具体为什么还不清楚
在整合Spring、SpringMVC、MyBatis(SSM)与Shiro后,遇到Bean创建异常,具体表现为'BeanCreationException',无法解析'shiroFilter'和'securityManager'。错误信息中指出'shiroRealm'的'loginService'依赖注入失败,原因是缺少符合类型的LoginService bean。经过他人指导和自我排查,发现在*Mapper.xml文件中返回类型未使用全限定名可能导致此问题,修复后问题得到解决。
339

被折叠的 条评论
为什么被折叠?



