SSM整合shiro后一直出现“ShiroFilter”的错误

在整合Spring、SpringMVC、MyBatis(SSM)与Shiro后,遇到Bean创建异常,具体表现为'BeanCreationException',无法解析'shiroFilter'和'securityManager'。错误信息中指出'shiroRealm'的'loginService'依赖注入失败,原因是缺少符合类型的LoginService bean。经过他人指导和自我排查,发现在*Mapper.xml文件中返回类型未使用全限定名可能导致此问题,修复后问题得到解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

整合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中,返回类型没有写全路径的问题
具体为什么还不清楚

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值