<jaxrs:client> not getting autowired
Posted
by
himangshu
on Stack Overflow
See other posts from Stack Overflow
or by himangshu
Published on 2010-12-25T15:49:02Z
Indexed on
2010/12/25
15:54 UTC
Read the original article
Hit count: 237
I am trying to build a restful client using jaxrs:client as defined in http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml
In my test class I am getting org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.abc.service.ExportServiceTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.bankbazaar.service.ExportService com.abc.service.ExportServiceTest.exportClient; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.abc.service.ExportService] 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=exportClient)}
this is my spring config
However
exportClient=(ExportService)applicationContext.getBean("exportClient");
this works.
Thanks Himangshu
© Stack Overflow or respective owner