FWIW, I ran in to this problem as well (at least the described error response) 
when I tried uploading files using apache http client.  text/plain files would 
work no problem, but same code (with appropriate change in content type) would 
fail cxf-side when sending an image.

I upgraded cxf from 2.2.5 to 2.3.1, did not help.  I looked at the wire, and 
saw that in the case of the binary file, the boundary marker was indeed messed 
up.

Upgraded from httpclient 3.1 to 4.0 (and to http core 4.1) and the problem went 
away.

It may have been that I was doing something wrong client side (I was following 
some basic example I found on the web), but the basic example I found for 4.0 
worked no problem.

just FYI.

Linus


> -----Original Message-----
> From: Gabriel Guardincerri [mailto:[email protected]]
> Sent: Thursday, July 08, 2010 9:38 PM
> To: [email protected]
> Subject: Re: Problem with a multipart request "Couldn't find MIME boundary"
> 
> Hi Sergey,
> 
> No problem.
> 
> I couldn't find the issue but could be something related with our code,
> since it works in another place. I'll keep trying :)
> 
> Thanks for the tips,
> 
> Gabriel
> 
> On Wed, Jul 7, 2010 at 6:07 PM, Sergey Beryozkin <[email protected]>wrote:
> 
> > Hi
> > sorry for a late reply - have you made it working ?
> > Can you update the form to send the request through 8081 and trace what is
> > happening on the wire ? You may also want to try a later CXF version, the
> > issue, if any, may've been already fixed
> >
> > cheers, Sergey
> >
> > On Fri, Jul 2, 2010 at 11:13 PM, Gabriel Guardincerri <[email protected]
> > >wrote:
> >
> > > Hi
> > >
> > > I'm trying to implement a REST WS to upload images with CXF 2.2.6 but I'm
> > > getting a "*
> > > Couldn't find MIME boundary" error and I don't know what's wrong.
> > > *
> > >
> > > This is what I have:
> > >
> > > First the REST interface:
> > >
> > > @Produces("text/xml")
> > > public interface ImageService {
> > >
> > >    @POST
> > >    @Path("/{userId}")
> > >    @Consumes("multipart/form-data")
> > >    Response upload(@PathParam("userId") String userId, MultipartBody
> > body);
> > > }
> > >
> > > Then I do a POST with this
> > >
> > > <form action="http://localhost:8080/upload/1";
> > > enctype="multipart/form-data"
> > > method="post">
> > > <p>
> > > Type some text (if you like):<br>
> > > <input type="text" name="textline" size="30">
> > > </p>
> > > <p>
> > > Please specify a file, or a set of files:<br>
> > > <input type="file" name="datafile" size="40">
> > > </p>
> > > <div>
> > > <input type="submit" value="Send">
> > > </div>
> > > </form>
> > > *
> > > *
> > > *I get this error *
> > > *
> > > *
> > > *
> > > WARN org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper -
> > > WebApplicationException has been caught : Couldn't find MIME boundary:
> > > ------WebKitFormBoundaryjoiEMONkidNgL2wU
> > >
> > > Any ideas?
> > >
> > > Thanks in advance,
> > >
> > > Gabriel
> > > *
> > >
> >


Reply via email to