shiro+swagger The dependencies of some of the beans in the application context form a cycle:

shiro+swagger The dependencies of some of the beans in the application context form a cycle:,第1张

shiro+swagger The dependencies of some of the beans in the application context form a cycle:

springboot整合shiro swagger后启动报错

The dependencies of some of the beans in the application context form a cycle:

   objectMapperConfigurer defined in class path resource [springfox/documentation/spring/web/SpringfoxWebMvcConfiguration.class]
      ↓
   org.springframework.cache.annotation.ProxyCachingConfiguration
      ↓
   authorizationAttributeSourceAdvisor defined in class path resource [org/apache/shiro/spring/boot/autoconfigure/ShiroAnnotationProcessorAutoConfiguration.class]
┌─────┐
|  defaultSecurityManager defined in class path resource [com/lth/config/shiro/ShiroConfig.class]
↑     ↓
|  shiroFilterFactoryBean defined in class path resource [com/lth/config/shiro/ShiroConfig.class]
└─────┘

解决方式

    
    @Bean
    public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(@Qualifier("defaultSecurityManager") DefaultSecurityManager securityManager) {
        AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor();
        advisor.setSecurityManager(securityManager);
        return advisor;
    }

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5609301.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-15
下一篇2022-12-15

发表评论

登录后才能评论

评论列表(0条)

    保存