junit集成maven。 No SecurityManager accessible to the calling code, either bound to the org.apache.shir

来源:互联网 发布:java filter过滤器实例 编辑:程序博客网 时间:2024/05/20 20:23

启动JUNIT,检查到缺少SecurityManager。

需要在shiro.xml中加入

<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">  
<property name="staticMethod" value="org.apache.shiro.SecurityUtils.setSecurityManager"/>  
    <property name="arguments" ref="securityManager"/>  
</bean>

0 0