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

Using @MultipartForm doesn't work with ResteasyClientBuilder

    Details

    • Steps to Reproduce:
      Hide

      Run JUnit with class ClientRequestTest:
      testNewBuilder() doesn't work correctly.

      Show
      Run JUnit with class ClientRequestTest: testNewBuilder() doesn't work correctly.

      Description

      I tried to upload an attachment via Multipart. For that i use the client proxy api.

      The proxy interface has a method like this:

      @Path("test/{key}")
      @Consumes("multipart/form-data")
      @POST
      public void postAttachment(@MultipartForm Attachment attachment, @PathParam("key") String key)
      

      When i generate the proxy with the old ProxyFactory it can send the POST, but an exception is thrown with the new ResteasyClientBuilder:

      javax.ws.rs.ProcessingException: could not find writer for content-type multipart/form-data type: de.markant.anwendkart.client.Attachment
      

      The problem seems to be, that the variable "annotations" in ResteasyProviderFactory.getClientMessageBodyWriter() is not correctly filled with a proxy generated by the new ResteasyClientBuilder. Without it, the correct MessageBodyWriter(MultipartFormAnnotationWriter) is not used.

      The test project i used is attached.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bill.burke Bill Burke
                  Reporter:
                  Rond Torsten Schöne
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: