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

Asynchronous IO not working with Netty

    XMLWordPrintable

    Details

    • Steps to Reproduce:
      Hide

      Checkout https://github.com/LarsKaulen/ResteasyMultipartExample/tree/RESTEASY-2627 and run the Main.java class.

      Execute curl --location --request POST 'localhost:8080/service/example' --form 'content=example string'

      The output I receive is:

      --c7200df8-4efe-4ee2-8fa0-f2bea853758e
      Content-DispositionContent-Type: : form-data; name="content"application/octet-stream
      
      example string
      --c7200df8-4efe-4ee2-8fa0-f2bea853758e-- 

      As you can see, the Content-Disposition and Content-Type headers are scrumbled together, which leads to the following error message (using org.eclipse.jetty:jetty-util:9.2.28.v20190418)

      java.io.IOException: Missing content-disposition
      	at org.eclipse.jetty.util.MultiPartInputStreamParser.parse(MultiPartInputStreamParser.java:555)
      	at org.eclipse.jetty.util.MultiPartInputStreamParser.getPart(MultiPartInputStreamParser.java:422) 

      I wasn't able to create a simple JUnit test which produces the same output and I wanted to keep it simple for the ticket, so I hope it is okay to use the curl command.

      Show
      Checkout https://github.com/LarsKaulen/ResteasyMultipartExample/tree/RESTEASY-2627 and run the  Main.java class. Execute curl --location --request POST 'localhost:8080/service/example' --form 'content=example string' The output I receive is: --c7200df8-4efe-4ee2-8fa0-f2bea853758e Content-DispositionContent-Type: : form-data; name= "content" application/octet-stream example string --c7200df8-4efe-4ee2-8fa0-f2bea853758e-- As you can see, the  Content-Disposition and  Content-Type headers are scrumbled together, which leads to the following error message (using org.eclipse.jetty:jetty-util:9.2.28.v20190418 ) java.io.IOException: Missing content-disposition at org.eclipse.jetty.util.MultiPartInputStreamParser.parse(MultiPartInputStreamParser.java:555) at org.eclipse.jetty.util.MultiPartInputStreamParser.getPart(MultiPartInputStreamParser.java:422) I wasn't able to create a simple JUnit test which produces the same output and I wanted to keep it simple for the ticket, so I hope it is okay to use the curl command.

      Description

      After RESTEASY-2480 was resolved and version 4.5.5.Final released I tried to integrate this new version.

      Now I have problems with multipart/form-data responses due to the new asynchronous API, as the headers are sent disordered and therefore the message is not recognized as a valid response.
      I use netty as backend.

      Is there a possibility to explicitly avoid the new asynchronous API?

        Attachments

          Activity

            People

            Assignee:
            rsearls r searls
            Reporter:
            lars_ka Lars Kaulen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: