<jaxrs: client> does not receive auto-update

I am trying to create a calm client using jaxrs: client, as defined at 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 get org.springframework.beans.factory.BeanCreationException: Error creating bean named "com.abc.service.ExportServiceTest": injection of auto-notified dependencies failed; The nested exception is org.springframework.beans.factory.BeanCreationException: Failed to create autwire field: private com.bankbazaar.service.ExportService com.abc.service.ExportServiceTest.exportClient; The nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: no bean match found for type [com.abc.service.ExportService] for the dependency: at least 1 bean is expected to qualify as an autwire 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 configuration                                                     

However

    exportClient=(ExportService)applicationContext.getBean("exportClient");

it works.

Thanks Himangshu

+3
source share
1 answer

The full name of the class for two ExportService looks different com.abc.service.ExportServicevs com.bankbazaar.service.ExportService. Fixing two pointing to the same name should fix the problem. Check the package name ExportService, defined through applicationContext.getBean (), to determine the difference.

0
source

Source: https://habr.com/ru/post/1782091/


All Articles