spring boot启动报错
Description:
Field SmsEntitys in com.example.wangyanan.controller.SmsController required a single bean, but 2 were found:
- smsEntity: defined in file [E:\project\workspace-eclipse-dlr-branch\wangyanan\target\classes\com\example\wangyanan\properties\SmsEntity.class]
- sms-com.example.wangyanan.properties.SmsEntity: defined in null
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
有一种情况是因为启动类里边加了如下注解
实体类被调用的时候又注入了一次