1. 程式人生 > 實用技巧 >Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definiti

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definiti

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'beanNameViewResolver', defined in class path resource [cn/afterturn/easypoi/configuration/EasyPoiAutoConfiguration.class], could not be registered. A bean with that name has already been defined in
class path resource [org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class] and overriding is disabled. Action: Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

昨天還好好的專案,今天突然提示這個錯誤,看提示好像是EasyPoi的一個Bean的註冊和Spring中的一個Bean的註冊名稱碰撞了

下面提示可以採用覆蓋註冊解決

在YML中配置之後可以正常啟動,但是不知道會不會對後期有影響

有知道的大佬可以在評論區指定我一下,謝謝

作者:彼岸舞

時間:2021\01\07

內容關於:工作中用到的小技術

本文屬於作者原創,未經允許,禁止轉發