ssm整合報錯

怎麼說,我也是SSM老司機了,竟然在小陰溝頭翻了船
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.ItemService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}


解析:沒有找到合格的IoFactoryService,首先到applicationContext-service.xml中看看有沒有配置組件掃描
<!-- 掃描包加載Service實現類 -->
<context:component-scan base-package="com.ankele.service"></context:component-scan>
很明顯,配置了的。沒有懷疑其他的配置信息有問題,因爲異常已經表明——沒有對應的Service。那很有可能是ServiceImplement類沒有註解@Service了。


微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑微笑

果然,問題解決了。


發佈了53 篇原創文章 · 獲贊 5 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章