SpringBoot不自动加载Shiro配置 (No bean of type 'org.apache.shiro.realm.Realm' found)

在很多SpringBoot项目中,common或者parent 做了shiro依赖,这样其他模块项目 总是提示 No bean of type 'org.apache.shiro.realm.Realm' found

Action:

Please create bean of type 'Realm' or add a shiro.ini in the root classpath (src/main/resources/shiro.ini) or in the META-INF folder (src/main/resources/META-INF/shiro.ini).

其实就是SpringBoot自动加载机制,在

shiro-spring-boot-starter 有默认配置。所以需要屏蔽shiro  怎么办???这是第二次哉到这里了   

自己乱琢磨  在

@SpringBootApplication( 输入 ShiroAutoConfiguration 把出现的三个匹配的项目排除 就可以了
@SpringBootApplication(exclude = {ShiroAnnotationProcessorAutoConfiguration.class, ShiroAutoConfiguration.class, ShiroBeanAutoConfiguration.class})

就ok了  真好 休息一下。。

发布了70 篇原创文章 · 获赞 16 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/ucicno000/article/details/104581726