How are you resolving this issue in your stack trace?

Caused by: java.lang.ClassNotFoundException:
org.glassfish.jersey.internal.RuntimeDelegateImpl cannot be found by
javax.ws.rs_2.0.1.v201504171603

On Wed, Nov 13, 2019 at 9:06 AM Christian Pontesegger <christian.pontesegger@web.de> wrote:
Hi,

I tried to build a simple Rest client with resteasy 4.4.0:

@Path("/v2/store")
public interface IStoreService {

        @GET
        @Path("inventory")
        @Produces(MediaType.APPLICATION_JSON)
        Response getInventory();
}

public class ServiceTest {

        public static IStoreService createStoreService() throws
URISyntaxException {

                ResteasyClient client = new
ResteasyClientBuilderImpl().build();
                ResteasyWebTarget target = client.target(new URI("
https://petstore.swagger.io/"));
                return target.proxy(IStoreService.class);
        }

        public static Response test() throws URISyntaxException {
                IStoreService storeService = createStoreService();
                return storeService.getInventory();
        }
}

Works nicely as a standalone java project. But once I try to push this
to an Eclipse plugin project for RCP, things start to fail. I put
everything into a single plugin, packing all resteasy jars into the
plugin to have them available using the sample plugin classloader.
Still ServiceTest.test() fails throwing an exception (see below).

Anyone ever tried to do such a thing? What am I missing?

thanks
Christian

Exception:
Java Stacktrace:
java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003940:
Unable to instantiate MessageBodyReader
        at
org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterB
uiltin.java:88)
        at
org.jboss.resteasy.plugins.providers.RegisterBuiltin.getClientInitializ
edResteasyProviderFactory(RegisterBuiltin.java:64)
        at
org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.getP
roviderFactory(ResteasyClientBuilderImpl.java:354)
        at
org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.buil
d(ResteasyClientBuilderImpl.java:367)
        at
com.codeandme.restclient.resteasy.ServiceFactory.createStoreService(Ser
viceFactory.java:16)
        at
com.codeandme.restclient.resteasy.ServiceFactory.test(ServiceFactory.ja
va:22)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
va:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
rImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
        at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
        at
org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:8
5)
        at org.mozilla.javascript.gen.c_5._c_script_0(Unknown Source)
        at org.mozilla.javascript.gen.c_5.call(Unknown Source)
        at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:405
)
        at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3508)
        at org.mozilla.javascript.gen.c_5.call(Unknown Source)
        at org.mozilla.javascript.gen.c_5.exec(Unknown Source)
        at
org.mozilla.javascript.Context.evaluateReader(Context.java:1293)
        at
org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine.internalExecut
e(RhinoScriptEngine.java:219)
        at
org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine.execute(RhinoS
criptEngine.java:198)
        at
org.eclipse.ease.AbstractScriptEngine.inject(AbstractScriptEngine.java:
226)
        at
org.eclipse.ease.AbstractScriptEngine.run(AbstractScriptEngine.java:277
)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.RuntimeException: RESTEASY003940: Unable to
instantiate MessageBodyReader
        at
org.jboss.resteasy.core.providerfactory.ClientHelper.processProviderCon
tracts(ClientHelper.java:152)
        at
org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.pro
cessProviderContracts(ResteasyProviderFactoryImpl.java:884)
        at
org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.reg
isterProvider(ResteasyProviderFactoryImpl.java:876)
        at
org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.reg
isterProvider(ResteasyProviderFactoryImpl.java:863)
        at
org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(
RegisterBuiltin.java:172)
        at
org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterB
uiltin.java:84)
        ... 24 more
Caused by: java.lang.RuntimeException:
java.lang.ClassNotFoundException:
org.glassfish.jersey.internal.RuntimeDelegateImpl cannot be found by
javax.ws.rs_2.0.1.v201504171603
        at
javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:152)
        at
javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120)
        at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
        at
org.jboss.resteasy.core.providerfactory.ClientHelper.addMessageBodyRead
er(ClientHelper.java:449)
        at
org.jboss.resteasy.core.providerfactory.ClientHelper.processProviderCon
tracts(ClientHelper.java:146)
        ... 29 more
Caused by: java.lang.ClassNotFoundException:
org.glassfish.jersey.internal.RuntimeDelegateImpl cannot be found by
javax.ws.rs_2.0.1.v201504171603
        at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleL
oader.java:511)
        at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.ja
va:422)
        at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.ja
va:414)
        at
org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClas
sLoader.java:153)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at
javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:115)
        at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:225)
        at
javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:135)
        ... 33 more




_______________________________________________
resteasy mailing list
resteasy@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/resteasy