Hi

Please add a cglib-nodeps to your classpath

Cheers, Sergey
On 05/11/13 05:57, liugang594 Liu wrote:
Hi All:
I have a question about
org.apache.cxf.jaxrs.client.JAXRSClientFactory.create(String, Class<T>) ,
the class object must be an interface ? I saw the doc said "if not
interface then a CGLIB proxy will be created", but I always got some error
when I'm tring to use a concrete class object:

SEVERE: java.lang.IllegalArgumentException : *.*.CategoryService is not an
interface
Exception in thread "main" java.lang.IllegalArgumentException:
*.*.CategoryService is not an interface
  at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:493)
  at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:713)
  at
org.apache.cxf.common.util.ProxyHelper.getProxyInternal(ProxyHelper.java:46)
  at org.apache.cxf.common.util.ProxyHelper.getProxy(ProxyHelper.java:86)
  at
org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWithValues(JAXRSClientFactoryBean.java:312)
  at
org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.create(JAXRSClientFactoryBean.java:251)
  at
org.apache.cxf.jaxrs.client.JAXRSClientFactory.create(JAXRSClientFactory.java:86)
  at
org.apache.cxf.jaxrs.client.JAXRSClientFactory.create(JAXRSClientFactory.java:72)
  at
org.apache.cxf.jaxrs.client.JAXRSClientFactory.create(JAXRSClientFactory.java:49)
  at *.*.*ProxyClient.main(BookstoreProxyClient.java:11)


The code looks like:

CategoryService categoryService = JAXRSClientFactory.create("
http://localhost:8383/rs";, CategoryService.class);
Category category = categoryService.getCategory("categoryId1");



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to