在我的應用程序有任務的細節3個單獨的項目:類路徑問題
- 一個Java項目服務層和DAO層(使用Spring DI) -
business.jar
- 一個Java項目WS客戶 -
WSClient.jar
使用Spring MVC - Web項目 -
MyApp.war
現在我的問題是如何將所有的項目捆綁在一起,因爲Web應用程序有從business.jar
獲得服務和DAO的依賴關係,服務必須從調用Web服務的角度獲得WSClient.jar
的依賴關係。我必須使用Spring的classpath scan實用程序來自動連接所有這三個項目中的服務dao和控制器組件。
但是,讓錯誤,因爲服務層是不是在類路徑:
factory.NoSuchBeanDefinitionException: No matching bean of type
[com.amex.merchant.site.pop.service.POPRenderService] 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),
@org.springframework.beans.factory.annotation.Qualifier(value=pOPRenderService)}
請建議如何進行進一步
請張貼您的Spring配置。 – joschi
MSbusiness.jar中有一個名爲resources的文件夾,其中包含所有上下文xml,如用於服務和dao的msbusiness-context.xml。對於這個具體的例子,下面是在MSBusiness-context.xml中的服務條目 -我已經把MSbusiness.jar放入/ WEB-INF/lib /和裏面/WEB-INF/applicationContext.xml導入msbusiness-context.xml - 第一個問題是它沒有加載ms-businessContext.xml 。 –
user937967
請在您的問題中添加*完整* XML配置。 – joschi