shiroFilterFactoryBean that could not be found.

Description:

Method filterShiroFilterRegistrationBean in org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration required a bean named ‘shiroFilterFactoryBean’ that could not be found.

Action:

Consider defining a bean named ‘shiroFilterFactoryBean’ in your configuration.
解决方案:

    
        org.apache.shiro
        shiro-spring-boot-starter
        1.8.0
    

导入的依赖包是shiro-spring-boot-starter不是shiro-spring-boot-
web-starter
还是没有解决
在配置类里面的ShiroFilterFactoryBean 方法加
@Bean(name = “shiroFilterFactoryBean”)

 @Bean(name = "shiroFilterFactoryBean")
    public ShiroFilterFactoryBean getShiroFilterFactoryBean(@Qualifier("getDefaultWebSecurityManager") DefaultWebSecurityManager defaultWebSecurityManager){
        ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean();
        //设置安全管理器
        bean.setSecurityManager(defaultWebSecurityManager);
        return bean;
    }

解决!

你可能感兴趣的:(java,spring,spring,boot,java)