-
Bug
-
Resolution: Done
-
Major
-
3.0.8.Final
-
None
Just using a library doing a ClientBuilder.newClient, the following occurs:
org.jboss.resteasy.spi.LoggableFailure: Unable to find contextual data of type: javax.ws.rs.ext.Providers
at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:54)
at com.sun.proxy.$Proxy14.getMessageBodyReader(Unknown Source)
at org.jboss.resteasy.plugins.providers.multipart.MultipartInputImpl$PartImpl.getBody(MultipartInputImpl.java:283)
at test.Main.testResteasy(Main.java:184)
at test.Main.main(Main.java:63)
This happens, when the inputstream is read; I fixed it by adding the following initializing code:
ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
ResteasyProviderFactory.pushContext(javax.ws.rs.ext.Providers.class, factory);
ResteasyClientBuilder resteasyClientBuilder = new
ResteasyClientBuilder().providerFactory(factory);
ResteasyClient client = resteasyClientBuilder.build();