shiro+ssm项目无法访问jsp,目前怀疑shiro配置有问题导致无法注入,但不知道从何下手,大神求解

luoye_rcy luoye_rcy 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Error creating bean with name 'shiroFilter' defined in file [D:\Program Files\tomcat8\apache-tomcat-8.0.37\webapps\cloudparking\WEB-INF\classes\applicationContext-shiro.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager';
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realm" ref="shiroDbRealm" />
<property name="cacheManager" ref="shiroEhcacheManager" />
</bean>

<!-- 項目自定义的Realm, 所有accountService依赖的dao都需要用depends-on声明 -->
<bean id="shiroDbRealm" class="com.dnake.cloudparking.auth.AuthRealm" depends-on="userDao,userWechatDao,parkingTicketDao,userParkingTicketDao,jdbcQueryDao">
<property name="userService" ref="userService" />
</bean>
<!--

<bean id="sessionFilter"
class="com.dnake.cloudparking.auth.SessionFilter"> </bean>
-->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager" />
<property name="loginUrl" value="/login" />
<property name="successUrl" value="/index" />
<!--
<property name="filters"> <map> <entry key="sessionFilter"
value-ref="sessionFilter"/> </map> </property>
-->
<property name="filterChainDefinitions">
<value>
/ = anon
/login.jsp= anon
/index.jsp = anon
/login = anon
/syslogin = anon
/loginval = anon
/syslogout = anon
/servlet/AuthImageServlet = anon
/getBackPwdStep* = anon
/backuncheck/** = anon
/weixin/** = anon
/alipay/** = anon
/static/**= anon
/res/** = anon
/api/** = anon
/createScanQrCodeOrder = anon
/weixin/payNotify = anon
/alipay/payNotify = anon
/wxpay_refund_notify = anon
/register/** = anon
/app/* = anon
/parking.jsp = anon
/video.html = anon
/saveParking = anon
/admin/** =roles[admin]
/** = user

</value>
</property>

Error creating bean with name 'securityManager' defined in file [D:\Program Files\tomcat8\apache-tomcat-8.0.37\webapps\cloudparking\WEB-INF\classes\applicationContext-shiro.xml]: Cannot resolve reference to bean 'shiroDbRealm' while setting bean property 'realm';
Error creating bean with name 'shiroDbRealm': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dnake.cloudparking.service.UserService com.dnake.cloudparking.auth.AuthRealm.userService;
上述为与shiro有关的报错信息以及shiro.xml中我认为有用的内容
Error creating bean with name 'userService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dnake.cloudparking.dao.UserDao com.dnake.cloudparking.service.impl.UserServiceImpl.userDao;
这段报错信息应该是自动注入报错的地方
我的UserSercieImpl是以@Service注解的
在UserDao 类上加上@Repository注解没有用。。
我的UserDao是接口

求大神解答,实在搞不定

...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
luoye_rcy
Java EE 67,535 成员 225,843 内容