日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

required a single bean, but 2 were found

作者:Json_Marz 更新時間: 2024-03-24 編程語言

項目集成xxljob時,報錯:

Parameter 0 of method xxlJobSpringExecutor in com.wf.job.XxlJobAutoConfiguration required a single bean, but 2 were found:
	- xxlJobProperties: defined in URL [jar:file:/C:/Users/777/.m2/repository/com/xx/xx-xxl-job-spring-boot-starter/1.0.0/wf-xxl-job-spring-boot-starter-1.0.0.jar!/com/xx/job/properties/XxlJobProperties.class]
	- xx.xxl-job-com.xx.job.properties.XxlJobProperties: defined in null

因為xxljob組件是自己在xxljob的基礎上封裝的,然后項目啟動報錯,

原因是在啟動類加 `@ComponentScan` 注解,配置的包掃描路徑重復了,導致重新生成兩個bean,而且一個bean?defined in null.

解決辦法就是把包掃描的路徑改下,不能有包含關系。

原文鏈接:https://blog.csdn.net/Json_Marz/article/details/126762269

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新