1. 程式人生 > >junit整合maven。 No SecurityManager accessible to the calling code, either bound to the org.apache.shir

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

啟動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>