This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 248977 - NetBeans Platform as REST Client is broken
Summary: NetBeans Platform as REST Client is broken
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 8.1
Hardware: PC All
: P1 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-28 12:10 UTC by sreimers
Modified: 2015-04-02 03:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sreimers 2014-11-28 12:10:11 UTC
Trying to use the NetBeans Platform in RESTClient mode as described here https://netbeans.org/kb/72/websvc/jersey-rcp-client.html I discovered that from 8.0.1 onwards the configuration of websvc.restlib for the Jersey Implementation is bad.

Somewhere in the downgrading process of Jersey (#245294) it seems the classpath was broken. The missing piece I can confirm is cglib, which was on the classpath before but is now missing. The resulting exception is:

java.lang.ClassNotFoundException: net.sf.cglib.proxy.MethodInterceptor
	at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:222)
Caused: java.lang.ClassNotFoundException: net.sf.cglib.proxy.MethodInterceptor starting from ModuleCL@7d85e38d[org.netbeans.modules.websvc.restlib] with possible defining loaders null and declared parents [ModuleCL@79a9af8b[org.netbeans.modules.xml.jaxb.api], ModuleCL@610ddd47[org.netbeans.modules.j2ee.eclipselink]]
	at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:224)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Caused: java.lang.NoClassDefFoundError: net/sf/cglib/proxy/MethodInterceptor
	at org.jvnet.hk2.external.generator.ServiceLocatorGeneratorImpl.initialize(ServiceLocatorGeneratorImpl.java:71)
	at org.jvnet.hk2.external.generator.ServiceLocatorGeneratorImpl.create(ServiceLocatorGeneratorImpl.java:96)
	at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.internalCreate(ServiceLocatorFactoryImpl.java:251)
	at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.create(ServiceLocatorFactoryImpl.java:228)
	at org.glassfish.jersey.internal.inject.Injections._createLocator(Injections.java:142)
	at org.glassfish.jersey.internal.inject.Injections.createLocator(Injections.java:113)
	at org.glassfish.jersey.internal.RuntimeDelegateImpl.<init>(RuntimeDelegateImpl.java:60)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
	at java.lang.Class.newInstance(Class.java:433)
	at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:117)
	at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:207)
	at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:135)
	at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120)
	at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:95)
	at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
	at org.glassfish.jersey.client.JerseyWebTarget.<init>(JerseyWebTarget.java:72)
	at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:177)
	at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:68)

There is no workaround besides creating your own module.
Comment 1 Petr Hejl 2015-03-30 12:59:53 UTC
Is this coming from the platform application runtime? Can you provide the app for testing? The cglib seems to be included.
Comment 2 sreimers 2015-03-30 14:25:50 UTC
You are right, it is included but it is not on the classpath. The new version (2.10) did not use cglib, so it was removed from the distribution and removed from classpath. Reverting back to 2.5 cglib was added back to the distribution, but not to the classpath.
Comment 3 Petr Hejl 2015-04-01 09:58:33 UTC
Ok, I see. Should be fixed in web-main 46fe48d044f6.
Comment 4 Quality Engineering 2015-04-02 03:21:34 UTC
Integrated into 'main-silver', will be available in build *201504020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/46fe48d044f6
User: Petr Hejl <phejl@netbeans.org>
Log: #248977 - NetBeans Platform as REST Client is broken