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