當(dāng)前位置:
首頁(yè) >
前端技术
> 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
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
場(chǎng)景
SpringBoot項(xiàng)目在啟動(dòng)時(shí)提示:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or us
因?yàn)閟ringboot通過(guò)@Autowired注入接口的實(shí)現(xiàn)類時(shí)發(fā)現(xiàn)有多個(gè),也就是有多個(gè)類繼承了這個(gè)接口,spring容器不知道使用哪一個(gè)。
加@Primary表示某個(gè)實(shí)現(xiàn)類首選注入
總結(jié)
以上是生活随笔為你收集整理的SpringBoot中提示:Consider marking one of the beans as @Primary, updating the consumer to accept multipl的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: SpringBoot中通过自定义缓存注解
- 下一篇: 鸿蒙基于JS搭建HelloWorld并修