Shiro报错No SecurityManager accessible

2025-03-23 11:46:37

1、首先,我在web.xml里是配置了shiroFilter的,而且内容无误,如下图。

Shiro报错No SecurityManager accessible

2、然后在使用的时候,点击登录进行shiro登录认证。

Shiro报错No SecurityManager accessible

3、就报了下面的错误:org.apache.shiro.Unavaila水瑞侮瑜bleSecurityManagerException: No SecurityManager accessible to the calling code,either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an invalid application configuration.

Shiro报错No SecurityManager accessible

4、在网上找了好多方法,都说是没有在web.xml里加入shiroFilter,但事实上我加了啊。

Shiro报错No SecurityManager accessible

5、于是,找啊找,找了好几个小时,终于在另一篇文章中看到了,原来是shiroFilter应该放在strutsFilter的前面。

Shiro报错No SecurityManager accessible

6、于是,赶紧改了web.xml,然后一试,果然是这样。终于成功了。正确登录后页面显示出来了,如下图。

Shiro报错No SecurityManager accessible
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢