JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-5628

Mule breaks multipart/form-data encoded messages

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.1.1
  • Fix Version/s: 3.1.4 (EE only), 3.2.1
  • Component/s: Modules: Jersey
  • Labels:
    • jersey
    • mule
  • Environment:

    Fedora 15
    java-1.6.0-openjdk-1.6.0.0-58.1.10.2.fc15.i686

  • User impact:
    High
  • Configuration:
    Hide
    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:spring="http://www.springframework.org/schema/beans"
    xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
    http://www.mulesoft.org/schema/mule/jersey
    http://www.mulesoft.org/schema/mule/jersey/3.0/mule-jersey.xsd
    http://jersey.apache.org/core http://jersey.apache.org/schemas/core.xsd">
    
    	<flow name="X12ToSummaryHtml">
    		<inbound-endpoint address="http://localhost:8080/jersey" />
    		<jersey:resources>
    			<component class="com.optuminsight.unionstation.service.X12ToSummaryHtml" />
    		</jersey:resources>
    	</flow>
    </mule>
    @POST
        @Path("/getSummaryHtml")
        @Consumes(MediaType.MULTIPART_FORM_DATA)
        @Produces("text/html")
        public final Response getSummaryHtml(@FormDataParam("x12file") final InputStream x12file) throws IOException {
            LOG.info("called getSummaryHtml");
            return Response.ok(IOUtils.toString(x12file)).build();
        }
    Show
    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:spring="http://www.springframework.org/schema/beans"
    xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
    http://www.mulesoft.org/schema/mule/jersey
    http://www.mulesoft.org/schema/mule/jersey/3.0/mule-jersey.xsd
    http://jersey.apache.org/core http://jersey.apache.org/schemas/core.xsd">
    
    	<flow name="X12ToSummaryHtml">
    		<inbound-endpoint address="http://localhost:8080/jersey" />
    		<jersey:resources>
    			<component class="com.optuminsight.unionstation.service.X12ToSummaryHtml" />
    		</jersey:resources>
    	</flow>
    </mule>
    @POST
        @Path("/getSummaryHtml")
        @Consumes(MediaType.MULTIPART_FORM_DATA)
        @Produces("text/html")
        public final Response getSummaryHtml(@FormDataParam("x12file") final InputStream x12file) throws IOException {
            LOG.info("called getSummaryHtml");
            return Response.ok(IOUtils.toString(x12file)).build();
        }
  • Log Output:
    Hide
    About to connect() to localhost port 8080 (#0)
    Trying 127.0.0.1... connected
    Connected to localhost (127.0.0.1) port 8080 (#0)

    POST /jersey/X12ToSummaryHtml/getHtml/ HTTP/1.1
    User-Agent: curl/7.21.3 (i386-redhat-linux-gnu) libcurl/7.21.3 NSS/3.12.10.0 zlib/1.2.5 libidn/1.19 libssh2/1.2.7
    Host: localhost:8080
    Accept: /
    Content-Length: 2706
    Expect: 100-continue
    Content-Type: multipart/form-data; boundary=----------------------------55b24ac88245
    < HTTP/1.1 100 Continue
    < Content-Type: text/plain
    < Content-Length: 0
    < Connection: close
    < HTTP/1.1 400 Bad Request
    < Content-Type: multipart/form-data; boundary=----------------------------55b24ac88245
    < Date: Sat, 25 Jun 2011 01:29:10 MDT
    < Server: Mule Core/3.1.1
    < Expires: Sat, 25 Jun 2011 01:29:10 MDT
    < http.status: 400
    < MULE_ENCODING: UTF-8
    < Transfer-Encoding: chunked
    < Connection: close
    <
    Show
    About to connect() to localhost port 8080 (#0) Trying 127.0.0.1... connected Connected to localhost (127.0.0.1) port 8080 (#0) POST /jersey/X12ToSummaryHtml/getHtml/ HTTP/1.1 User-Agent: curl/7.21.3 (i386-redhat-linux-gnu) libcurl/7.21.3 NSS/3.12.10.0 zlib/1.2.5 libidn/1.19 libssh2/1.2.7 Host: localhost:8080 Accept: / Content-Length: 2706 Expect: 100-continue Content-Type: multipart/form-data; boundary=----------------------------55b24ac88245 < HTTP/1.1 100 Continue < Content-Type: text/plain < Content-Length: 0 < Connection: close < HTTP/1.1 400 Bad Request < Content-Type: multipart/form-data; boundary=----------------------------55b24ac88245 < Date: Sat, 25 Jun 2011 01:29:10 MDT < Server: Mule Core/3.1.1 < Expires: Sat, 25 Jun 2011 01:29:10 MDT < http.status: 400 < MULE_ENCODING: UTF-8 < Transfer-Encoding: chunked < Connection: close <
  • Similar Issues:
    None

Description

I wrote a Jersey class that was supposed to accept a multipart/form-data encoded POST from a html form. It returned a 400 error. Digging into the actual problem, I found that a MIMEParsingException is being thrown by mimepull (a Jersey dependency). The body of the post is getting corrupted somehow. I've confirmed that the Jersey class is working correctly by deploying it in a Jetty container and testing it there.

Until this gets fixed, I can't create a web service that accepts files

The original report is at http://forums.mulesoft.org/thread.jspa?messageID=16784#16784

Issue Links

is duplicated by

Bug - A problem which impairs or prevents the functions of the product. MULE-5828 POSTing a multipart/form-data message w/o a payload parameter throws IllegalArgumentException

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Mark Bonano added a comment - 26/Sep/11 11:07 AM

I have encounter the same issue running Mule 3.2.0. Is someone looking into this? Multipart/form-data encoding is a requirement for my project and this fix is mission-critical.

Show
Mark Bonano added a comment - 26/Sep/11 11:07 AM I have encounter the same issue running Mule 3.2.0. Is someone looking into this? Multipart/form-data encoding is a requirement for my project and this fix is mission-critical.
Hide
Permalink
Santiago Vacas added a comment - 29/Sep/11 03:45 PM

3.1.x: https://fisheye.codehaus.org/changelog/mule/?cs=23032

Show
Santiago Vacas added a comment - 29/Sep/11 03:45 PM 3.1.x: https://fisheye.codehaus.org/changelog/mule/?cs=23032
Hide
Permalink
Ben Mathews added a comment - 11/Oct/11 03:36 PM

This fisheye link doesn't work. Is there a good one to look at the patch? Is it going to get merged?

I looked at Santiago's commit stream at https://fisheye.codehaus.org/user/svacas and didn't see anything that seemed to match this bug.

Show
Ben Mathews added a comment - 11/Oct/11 03:36 PM This fisheye link doesn't work. Is there a good one to look at the patch? Is it going to get merged? I looked at Santiago's commit stream at https://fisheye.codehaus.org/user/svacas and didn't see anything that seemed to match this bug.
Hide
Permalink
Ben Mathews added a comment - 12/Oct/11 01:36 PM

There isn't any commit that I can find, so nothing to merge.

Show
Ben Mathews added a comment - 12/Oct/11 01:36 PM There isn't any commit that I can find, so nothing to merge.
Hide
Permalink
Santiago Vacas added a comment - 13/Oct/11 08:55 AM

fisheye seems to be taking ages to scan the repository.
You can use svn diff to see the changes:

svn diff -c23032 https://svn.codehaus.org/mule/branches/mule-3.1.x

Show
Santiago Vacas added a comment - 13/Oct/11 08:55 AM fisheye seems to be taking ages to scan the repository. You can use svn diff to see the changes: svn diff -c23032 https://svn.codehaus.org/mule/branches/mule-3.1.x
Hide
Permalink
Ben Mathews added a comment - 17/Oct/11 02:49 PM

I built a patched version of 3.2.0 with the above commit and it works great. Thanks.

Show
Ben Mathews added a comment - 17/Oct/11 02:49 PM I built a patched version of 3.2.0 with the above commit and it works great. Thanks.
Hide
Permalink
Santiago Vacas added a comment - 18/Oct/11 07:53 AM

3.1.x: https://fisheye.codehaus.org/changelog/mule/?cs=23032
3.2.x: https://fisheye.codehaus.org/changelog/mule/?cs=23160
3.x: http://fisheye.codehaus.org/changelog/mule/?cs=23162

Show
Santiago Vacas added a comment - 18/Oct/11 07:53 AM 3.1.x: https://fisheye.codehaus.org/changelog/mule/?cs=23032 3.2.x: https://fisheye.codehaus.org/changelog/mule/?cs=23160 3.x: http://fisheye.codehaus.org/changelog/mule/?cs=23162

People

  • Assignee:
    Santiago Vacas
    Reporter:
    Ben Mathews
Vote (1)
Watch (0)

Dates

  • Created:
    01/Jul/11 11:53 AM
    Updated:
    12/Dec/11 08:24 AM
    Resolved:
    18/Oct/11 03:32 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.