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這個包里面就不會報錯。