首页 > Web开发 > 详细

当shiro做成动态URL管理时出现循环注入BeanCurrentlyInCreationException的问题解决方法

时间:2016-12-30 10:10:56      阅读:901      评论:0      收藏:0      [点我收藏+]
<!-- Shiro的Web过滤器 -->
    <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
        <property name="securityManager" ref="securityManager"/>

    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject" ref="shiroFilter"/>
        <property name="targetMethod" value="setFilterChainResolver"/>
        <property name="arguments" ref="filterChainResolver"/>
    </bean>

改为

@Bean
    public ShiroFilterFactoryBean shiroFilterFactoryBean() throws Exception{
        ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean();
        bean.setSecurityManager(securityManager());
        AbstractShiroFilter shiroFilter = (AbstractShiroFilter)bean.getObject();
        shiroFilter.setFilterChainResolver(pathMatchingFilterChainResolver());
        return bean;
    }

就可以解决,具体到底哪里的错我也没搞懂。

spring集成shiro的具体方案,请看开涛大神的博客:http://jinnianshilongnian.iteye.com/blog/2040929

当shiro做成动态URL管理时出现循环注入BeanCurrentlyInCreationException的问题解决方法

原文:http://www.cnblogs.com/jianguang/p/6235748.html

(2)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!