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. iOS抗锯齿的方式

    iOS开发中,有时候展示图片等内容的时候,会出现锯齿.比如笔者最近使用 iCarousel 控件的Cover flow效果来展示几幅图片时,两侧的图片出现了较为严重的锯齿,着实不好看.这里列出两个方式 ...

  2. 项目源码--Android视频MV类网站客户端

    下载源码 技术要点: 1.视频MV类网站客户端框架 2.底部TAB功能模块 3.用户管理模块 4.结合优质动画技术,良好的用户体验 5.用户设置模块 6.sqlite数据库灵活的应用 7.源码带有非常 ...

  3. 使用idea创建maven的web项目

    如果是第一次打开软件直接点击 Create New Project ,如果之前已经打开过项目了,需要点击菜单中 File → New Project … 如下图: 选择 Maven module ,输 ...

  4. a letter and a number

    描述we define f(A) = 1, f(a) = -1, f(B) = 2, f(b) = -2, ... f(Z) = 26, f(z) = -26;Give you a letter x ...

  5. iOS 应用首次开启 出现引导页面

    关于引导页面 ,可以是独立的一个视图控制器控制的滚动视图. 重点是处理 如何判断app是首次开启 而调用这个视图控制器得方法. 逻辑如下: -(BOOL)isFirstLoad { if(!标记第一次 ...

  6. TinyThread源码分析之中断

    转载请注明来源:cuixiaolei的技术博客 https://github.com/xhawk18/TinyThread TinyThread 是基于Cortex-M0的小型的OS. 知识储备: I ...

  7. spring--mybatis事务总结

    spring--事务原理.mybatis--MapperScannerConfigurer 和 mybatis--MapperProxy事务,最近想把spring mybatis中的事务和mapper ...

  8. 《UNIX环境高级编程》学习心得 四 文件I/O(一)

    这里说的文件I/O是相对标准I/O来说的.主要介绍在UNIX系统中常用的五个文件I/O函数:open.read.write.lseek.以及close. 一.open和opennat #include ...

  9. Java多线程之线程池

    现在是多核的时代,面向多核的编程很重要,因此基于java的并发和多线程开发非常重要. 线程池是于队列密切相关的,其中队列保存了所有等待执行的任务.工作者线程的任务很简单:从队列中获取一个任务,执行任务 ...

  10. About TI CC3000 Wifi

    http://forums.adafruit.com/viewtopic.php?f=22&t=44384http://learn.adafruit.com/adafruit-cc3000-w ...