springboot easypoi 报错The bean ‘beanNameViewResolver’, defined in class path resource [cn/afterturn/e

作者: adm 分类: java 发布时间: 2021-08-10

事故现场:

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配置即可解决

1
2
3
4
5
spring:
  application:
    name: SpringBoot_easyPOI
  main:
    allow-bean-definition-overriding: true

如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!