shiro错误No SecurityManager accessible to the calling code
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的更多相关文章
- SpringBoot2整合Shiro报错 UnavailableSecurityManagerException: No SecurityManager accessible to the calling code 【已解决】
SpringBoot集成Shiro报错 UnavailableSecurityManagerException: No SecurityManager accessible to the callin ...
- shiro错误总结
今天在做spring+mybatis+springmvc+shiro的时候,报这个错,刚开始以为是shiro登录验证出错,后来,观看一下错误,发现在别的xml中写错了代码,shiro接连着报错,记录一 ...
- shiro 错误登陆次数限制
第一步:在spring-shiro.xml 中配置缓存管理器和认证匹配器 <!-- 缓存管理器 使用Ehcache实现 --><bean id="cacheManager& ...
- [Shiro] tutorial 1 :SecurityManager and Subject
SecurityManager是Shiro的绝对核心,不同于java.lang.SecurityManager,每个应用程序都要有一个SecurityManager. 所以我们第一件事就是配置一个Se ...
- Shiro遇到的SecurityManager红色警告
问题如图 需要添加一个导入 import org.apache.shiro.mgt.SecurityManager; 这样就不会报错了
- shiro错误:Subject does not have permission [user:select]
使用的是jdbcRealm,在数据库中有相应的权限 错误日志: org.apache.shiro.authz.UnauthorizedException: Subject does not have ...
- 配置shiro错误
在web配置工程中配置shiro,如果启动Tomcat,报错:org.apache.shiro.web.config.WebIniSecurityManagerFactory.setDefaults ...
- 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监控下的宁波的数据库服务器出现了异常,但是当时正在检查查看其它服务器发过来的各类邮件,还没等到我去确认具体情 ...
- phpmailer发送邮件出现错误:stream_socket_enable_crypto(): SSL operation failed with code 1.
如果开了调试,调试进去会看到错误提示: smtp_code:"stream_socket_enable_crypto(): SSL operation failed with code 1. ...
随机推荐
- 定时导出Oracle数据表到文本文件的方法
该实例实现了通过windows定时任务来实现了将数据库中指定数据表数据导出为txt文本格式.其思路是通过可执行的bat文件去调用导出数据脚本,然后再在windows定时任务中调用该bat文件来实现.该 ...
- Use Spring Insight Developer to Analyze Code, Install it with Tomcat, and Extend it with Plugins--转载
原文地址:http://www.tomcatexpert.com/blog/2012/12/05/use-spring-insight-developer-analyze-code-install-i ...
- 汇编中 .fill 的作用
.fill 语法:.fill repeat, size, value 含义是反复拷贝 size个字节,重复 repeat 次, 其中 size 和 value 是可选的,默 ...
- BootStrap2学习日记19---缩略图
缩略图 代码: <ul class="thumbnails"> <li class="span3"><a href="# ...
- AngularJS特性
如果你不熟悉什么是Angular.js的话,小编我强烈推荐你阅读 Javascript教程:AngularJS的五个超酷特性.简单来说Angular.js是google开发者设计和开发的一套前端开发框 ...
- solr中通过SFTP访问文件建立索引
需求: 从oracle数据库中根据记录的文件名filename_html(多个文件以逗号隔开),文件路径path,备用文件名bakpath中获取 主机172.21.0.31上对应的html文件内容,并 ...
- Win Mingw-64获取
首先得了解下三种异常不同实现: SJLJ: slower but available for every architecture. SEH: fastest but limited to 64-bi ...
- 3. Android框架和工具之 xUtils(DbUtils )
1. xUtils简介 xUtils 包含了很多实用的android工具.xUtils 最初源于Afinal框架,进行了大量重构,使得xUtils支持大文件上传,更全面的http请求协议支持(10种谓 ...
- 整理的Unity导出安卓工程利用ANT进行多渠道批量打包APK
Unity导出的安卓工程利用ant进行多渠道循环批量打包 一:设置JAVA环境变量 做android开发的配置这个是基础. win7 下配置java环境变量,下面是链接 http://www.cnbl ...
- 使用Excel批量更改或插入SQL语句
在平常中我们可以通过使用SQL批量更新或新增更新数据库数据,对于这些都是有逻辑的数据可以这样处理但是对于无逻辑的数据我们如何处理(这里的数据比较多). 我是通过Excel的方式来处理的.以下已插入为例 ...