Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1119

Unable to find contextual data of type: javax.ws.rs.ext.Providers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.12.Final
    • 3.0.8.Final
    • jaxrs
    • None

    Description

      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();

      Attachments

        Activity

          People

            rsigal@redhat.com Ronald Sigal
            nmarasoiu nicolae marasoiu (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: