问答详情
源自:3-1 Shiro认证

请问报错UnavailableSecurityManagerException是什么回事

在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)


提问者:孙建博 2018-05-15 16:39

个回答

  • qq_慕姐7330780
    2022-12-07 00:07:44

    怎么解决的?


  • 孙建博
    2018-05-15 16:47:12

    呃,是自己的失误

    少了一句

    SecurityUtils.setSecurityManager(defaultSecurityManager);