cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Holger Delfs (JIRA)" <>
Subject [jira] Created: (CXF-2180) ProxyHelper requires cglib even if interface is used as client service class
Date Sat, 18 Apr 2009 16:52:14 GMT
ProxyHelper requires cglib even if interface is used as client service class

                 Key: CXF-2180
             Project: CXF
          Issue Type: Bug
          Components: Core, REST
    Affects Versions: 2.2
            Reporter: Holger Delfs

When using a JAX-RS proxy client with the spring bean

  <jaxrs:client id="subscriberService" serviceClass="sample.SubscriberService"

where sample.SubscriberService is an interface, I would expect, that I don't need cglib in
my classpath. Instead I get org.springframework.beans.factory.BeanCreationException with the
following root cause:

Caused by: java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Callback
	at org.apache.cxf.common.util.ProxyHelper.<clinit>(
	at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWithValues(
	at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.create(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	... 18 more
Caused by: java.lang.ClassNotFoundException: net.sf.cglib.proxy.Callback
	at Method)
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	at java.lang.ClassLoader.loadClassInternal(
	... 26 more

which I can only fix by including cglib in my Maven dependencies.

The catch block in the static initializer of ProxyHelper lets me assume, that the usage of
cglib features was intended to be optional. But if cglib.jar is not available, the class loading
of CglibProxyHelper causes the error above.

I suggest to either catch Throwable when calling CglibProxyHelper, or to avoid the class loading
dependency on cglib classes within CglibProxyHelper.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message