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了  真好 休息一下。。

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章