PowerBuilder快速入门实践 | 您所在的位置:网站首页 › powerbuilder教程百度网盘 › PowerBuilder快速入门实践 |
UnavailableSecurityManagerException: No SecurityManager accessible to the calling Spring Shiro异步配置
tfish2014: @Bean public FilterRegistrationBean shiroFilterRegistration(SecurityManager securityManager) throws Exception { FilterRegistrationBean registration = new FilterRegistrationBean(); registration.setFilter((Filter)shiroFilter(securityManager).getObject()); //该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理 registration.addInitParameter("targetFilterLifecycle", "true"); registration.setEnabled(true); //支持异步 registration.setAsyncSupported(true); registration.setDispatcherTypes(DispatcherType.REQUEST,DispatcherType.ASYNC); return registration; } @Bean public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) { ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); .......省略 shiroFilterFactoryBean.setFilterChainDefinitionMap(filterRuleMap); return shiroFilterFactoryBean; } SpringBoot不自动加载Shiro配置 (No bean of type 'org.apache.shiro.realm.Realm' found)qq_55533663: Field eventBus in org.apache.shiro.spring.config.AbstractShiroConfiguration required a bean of type 'org.apache.shiro.event.EventBus' that could not be found. The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true) SpringBoot不自动加载Shiro配置 (No bean of type 'org.apache.shiro.realm.Realm' found)蛤蟆卓: 这样shiro不就失效了吗? SpringBoot不自动加载Shiro配置 (No bean of type 'org.apache.shiro.realm.Realm' found)爱吃rabbit的mq: 这样shiro不就失效了吗 SpringBoot不自动加载Shiro配置 (No bean of type 'org.apache.shiro.realm.Realm' found)HuaLinNetWork@CSM: 把pom文件中导入的shiro注释掉即可,亲测有效 |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |