當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
SpringBoot中提示:Consider marking one of the beans as @Primary, updating the consumer to accept multipl
生活随笔
收集整理的這篇文章主要介紹了
SpringBoot中提示:Consider marking one of the beans as @Primary, updating the consumer to accept multipl
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
場景
SpringBoot項目在啟動時提示:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or us
因為sringboot通過@Autowired注入接口的實現類時發現有多個,也就是有多個類繼承了這個接口,spring容器不知道使用哪一個。
加@Primary表示某個實現類首選注入
總結
以上是生活随笔為你收集整理的SpringBoot中提示:Consider marking one of the beans as @Primary, updating the consumer to accept multipl的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SpringBoot中通过自定义缓存注解
- 下一篇: 信息系统项目管理师-计算题专题(一)进度