springboot easypoi 报错The bean 'beanNameViewResolver', defined in class path resource [cn/...

微笑、不失礼 提交于 2020-05-08 00:39:34

事故现场:

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


Process finished with exit code 1

 

解决办法:

在yml文件添加main配置即可解决

spring:
  application:
    name: SpringBoot_easyPOI
  main:
    allow-bean-definition-overriding: true

  

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!