Hi

It does work with Spring itself managing the actual injection, based on the stack trace, you write the code yourself by directly requesting a jaxrs:client bean.

Try to do create a bean like CustomerServiceProxy with a property 'customerService' set in Spring to refer to jaxrs:client, and then in your Main class get a CustomerServiceProxy bean from the application context.

Or the code like this would also work:

CustomerService proxy = ((JAXRSClientFactoryBean)ctx.getBean("customerService.proxyFactory")).create(CustomerService.class);

HTH, Sergey


On 07/06/15 22:23, axelr wrote:
I am trying to use Spring injection described here:
Injecting proxies
<http://cxf.apache.org/docs/jax-rs-client-api.html#JAX-RSClientAPI-Injectingproxies>



I am getting the following exception:



Of course CustomerService is an interface. To my opinion it must be an
interface. And to prove that I have used a class instead of this interface
and I am getting: demo.jaxrs.client.CustomerServiceImpl is not an interface.
BTW Using 'JAXRSClientFactory.create' everything works fine.

I have tried this using CXF 3.0.5 and 3.1.0.

What's wrong? Any ideas?




--
View this message in context: 
http://cxf.547215.n5.nabble.com/JAX-RS-Injecting-client-proxies-by-Spring-Specified-class-is-an-interface-tp5758058.html
Sent from the cxf-user mailing list archive at Nabble.com.


Reply via email to