我有這個在我的applicationContext.xml(我用http://cxf.apache.org/jaxrs)無法自動裝配JAXRS客戶
<context:annotation-config />
<context:component-scan base-package="br.com.test" />
<bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" />
<jaxrs:client id="testClient"
serviceClass="br.com.test.ws.InterfaceServiceTest"
address="http://localhost:8080/ocs-teste-ws-web/services/myservice">
<jaxrs:providers>
<ref bean="jsonProvider" />
</jaxrs:providers>
</jaxrs:client>
我包括在這個項目與接口的罐子,但我得到以下異常:
1318 [localhost-startStop-2]錯誤org.springframework.web.context.ContextLoader - 上下文初始化失敗 org.springframework.beans.factory.BeanCreationException:創建名爲'someBeanImpl'的bean時出錯:注入自動裝配依賴失敗;嵌套異常是org.springframework.beans.factory.BeanCreationException:無法自動裝入字段:br.com.test.ws.InterfaceServiceTest br.com.test.impl.SomeBeanImpl.interfaceServiceTest;嵌套的異常是org.springframework.beans.factory.NoSuchBeanDefinitionException:找不到匹配的[br.com.test.ws.InterfaceServiceTest]類型的依賴關係的bean:期望至少有1個符合該依賴關係的autowire候選者。依賴註釋:{@ org.springframework.beans.factory.annotation.Autowired(required = true)}
我在做什麼錯?
謝謝。
你能發表SomeBeanImpl的代碼嗎? – JustDanyul 2013-03-25 14:05:27