A bean with that name has already been defined and overriding is disabled.


关于OPENFEIGN使用后出现A BEAN WITH THAT NAME HAS ALREADY BEEN DEFINED AND OVERRIDING IS DISABLED.

网上查到的都是添加properties类型配置,这里给出我的yml配置

 

server:
  port: 8082
spring:
  application:
    name: xxx
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/xxx?useSSL=false&serverTimezone=Asia/Shanghai
    username: xxx
    password: xxx
  main:
    allow-bean-definition-overriding: true

注意格式,看似简单有可能上手配置就出错

相关