springboot啟動報錯:Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException:


springboot啟動類啟動的時候報錯:Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'errorPageFilter' for bean class [org.springframework.boot.web.support.ErrorPageFilter] conflicts with existing, non-compatible bean definition of same name and class [org.springframework.boot.context.web.ErrorPageFilter]

並且有這個提示:

** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

這個是主要因為把啟動類放在了頂級包Java里面,而沒有重新創個包放。如下圖,這樣就會報錯,如果放在baichen這個包里面就不會報錯。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM