Shire在Web.xml中shiroFilter的Mapping配置错误

org.apache.shiro.UnavailableSecurityManagerException: 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.

at org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:123)

at org.apache.shiro.subject.Subject$Builder.<init>(Subject.java:627)

at org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:56)

at com.feinno.module.security.web.JsonLoginController.login(JsonLoginController.java:41)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

出错的原因在于没有配置shiroFilter,应该在web.xml加入代码:

<!-- shiro -->
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

shiro错误No SecurityManager accessible to the calling code的更多相关文章

  1. SpringBoot2整合Shiro报错 UnavailableSecurityManagerException: No SecurityManager accessible to the calling code 【已解决】

    SpringBoot集成Shiro报错 UnavailableSecurityManagerException: No SecurityManager accessible to the callin ...

  2. shiro错误总结

    今天在做spring+mybatis+springmvc+shiro的时候,报这个错,刚开始以为是shiro登录验证出错,后来,观看一下错误,发现在别的xml中写错了代码,shiro接连着报错,记录一 ...

  3. shiro 错误登陆次数限制

    第一步:在spring-shiro.xml 中配置缓存管理器和认证匹配器 <!-- 缓存管理器 使用Ehcache实现 --><bean id="cacheManager& ...

  4. [Shiro] tutorial 1 :SecurityManager and Subject

    SecurityManager是Shiro的绝对核心,不同于java.lang.SecurityManager,每个应用程序都要有一个SecurityManager. 所以我们第一件事就是配置一个Se ...

  5. Shiro遇到的SecurityManager红色警告

    问题如图 需要添加一个导入 import org.apache.shiro.mgt.SecurityManager; 这样就不会报错了

  6. shiro错误:Subject does not have permission [user:select]

    使用的是jdbcRealm,在数据库中有相应的权限 错误日志: org.apache.shiro.authz.UnauthorizedException: Subject does not have ...

  7. 配置shiro错误

    在web配置工程中配置shiro,如果启动Tomcat,报错:org.apache.shiro.web.config.WebIniSecurityManagerFactory.setDefaults ...

  8. MS SQL错误:SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems

          早晨宁波那边的IT人员打电话告知数据库无法访问了.其实我在早晨也发现Ignite监控下的宁波的数据库服务器出现了异常,但是当时正在检查查看其它服务器发过来的各类邮件,还没等到我去确认具体情 ...

  9. phpmailer发送邮件出现错误:stream_socket_enable_crypto(): SSL operation failed with code 1.

    如果开了调试,调试进去会看到错误提示: smtp_code:"stream_socket_enable_crypto(): SSL operation failed with code 1. ...

随机推荐

  1. JavaScript目录

    1. 如何快速检查js语法学习Javascript 2. 如何快速掌握CSS(各种CSS工具)

  2. 基于jQuery上下切换的焦点图—带缩略图悬浮

    分享一款基于jQuery上下切换的焦点图,这款焦点图带有缩略图悬浮,它的切换效果比较简单,仅仅是作图片的上下切换,但是效果还是比较流畅的.这款jQuery焦点图插件的另外一个特点是在播放器上面可以悬浮 ...

  3. 用vim处理字符的大小写转换

    转载: http://blog.csdn.net/ruixj/article/details/3765385 http://www.linuxsong.org/2010/09/vim-convert- ...

  4. iOS (UIButton封装)仿糯米首页缩放“按钮”效果

    前言 过年期间,少不了各种聚会,当下聚会大多数情况下自然是团购,然后就是用各种APP...使用度娘糯米时(不是广告,不是广告,不是广告!),偶然注意到了它的首页中一个有意思的效果,就是那些“按钮”点击 ...

  5. c# checked unchecked 关键字

    checked 和 unchecked关键字用来限定检查或者不检查数学运算溢出的:如果使用了checked发生数学运算溢出时会抛出OverflowException:如果使用了unchecked则不会 ...

  6. jquery 请求apache solr 跨域解决方案

    <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script> ...

  7. 杂乱无章之Oracle(二)

    六.IMPDP用法 1.导入表 impdp hsiufo/hsiufo directory=dump_dir dumpfile=full.dmp tables=scott.emp remap_sche ...

  8. Flex学习总结

    Flex SDK Flex框架类库.Flex编译环境.调式器.MXML.ActionScript编程语言以及其它工具组成,Flash Builder是其开发环境,   Flash Player的工作模 ...

  9. 使用 mina 传输大字节数组

    转载自:http://seara520.blog.163.com/blog/static/16812769820103214817781/ 使用mina传输超过2k以上的数据时(采用tcp方式,如果是 ...

  10. Linux常用命令之seq

    标题:seq命令的使用 作用:seq命令用于以指定增量从首数开始打印数字到尾数,即产生从某个数到另外一个数之间的所有整数,并且可以对整数的格式.宽度.分割符号进行控制 语法: [1] seq [选项] ...