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. shiro配置类中少了 SecurityUtils.setSecurityManager(defaultSecurityManager); 位置: /** * Shiro 安全管理器 * * @return */ @Bean public SecurityManager securityManager() { DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); SecurityUtils.setSecurityManager(securityManager); securityManager.setRealm(myShiroRealm())