孙建博
2018-05-15 16:39
在springboot环境下测试的,会报错:
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:626)
at org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:56)
怎么解决的?
呃,是自己的失误
少了一句
SecurityUtils.setSecurityManager(defaultSecurityManager);
Shiro安全框架入门
48036 学习 · 332 问题
相似问题