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加入代码:

shiroFilterorg.springframework.web.filter.DelegatingFilterProxyshiroFilter/*,这种精神使人能在旅行中和大自然更加接近,

shiro错误No SecurityManager accessible to the calling code

相关文章:

你感兴趣的文章:

标签云: