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. php namespace use 命名空间

    也可以参考PHP官网说明:http://php.net/manual/en/language.namespaces.importing.php namespace(以下简称ns).在定义了一个ns之后 ...

  2. 代码片段 - JavaScript 字符串模板

    /* ------------------------------ // 字符串模板1,语法严格,不能混用,效率相对较高 // 使用 {{ }} 作为标记是为了允许在模板中使用 JSON 字符串 // ...

  3. 使用HttpURLConnection和AsyncTask从网络缓存图片

    1.创建NetCacheUtils中创建downloadBitmap(String url)方法 private Bitmap downloadBitmap(String url){ HttpURLC ...

  4. IOS UIwebview 背景色调整

    自定义webview背景色  重点是把webview弄成透明的 然后把self.view的背景调色即可 UIWebview 背景透明处理 让 UIWebView 背景透明需要以下设置 web_abou ...

  5. leetcode题解:Binary Tree Postorder Traversal (二叉树的后序遍历)

    题目: Given a binary tree, return the postorder traversal of its nodes' values. For example:Given bina ...

  6. iOS菜鸟总结1

    我从第一次接触OC,我觉得想要学好就必须有提前的知识的储备(比如c,java).这样就可更好了解面向对象的这一思想.学起来就不是很吃力了,本来OC就是比较难学的语言.工欲善其事,必先利其器,Xcode ...

  7. Linux_内存查询

    查询磁盘使用情况: [root@css-management ~]# df -hl 文件系统 容量 已用 可用 已用% 挂载点 Filesystem Size Used Avail Use% Moun ...

  8. JAVA中的deflate压缩实现

    在文件的传输过程中,为了使大文件能够更加方便快速的传输,一般采用压缩的办法来对文件压缩后再传输,JAVA中的java.util.zip包中的Deflater和Inflater类为使用者提供了DEFLA ...

  9. JavaScript break和continue 跳出循环

    在JavaScript中,使用 break 和 continue 语句跳出循环: break语句的作用是立即跳出循环,即不再执行后面的所有循环: continue语句的作用是停止正在执行的循环,直接进 ...

  10. 浅析为什么char类型的范围是 —128~+127

    转载于daiyutage 在C语言中, signed char 类型的范围为-128~127,每本教科书上也这么写,但是没有哪一本书上(包括老师)也不会给你为什么是-128~127,这个问题貌似看起来 ...