users@jersey.java.net

Re: [Jersey] ClientHandlerException: A message body writer for Java type, class com.sun.jersey.multipart.MultiPart, and MIME media type, application/octet-stream, was not found

From: Craig McClanahan <Craig.McClanahan_at_Sun.COM>
Date: Fri, 12 Dec 2008 13:07:30 -0800

Gili wrote:
>
> I'm using 1.0.2-snapshot (latest trunk) for all of them.
> Setting the
> mediaType didn't help. Again it's worth pointing out it's complaining
> about the MultiPart's mediaType, not the body part. I tried explicitly
> setting the MultiPart's mediaType but this didn't help.
>
> Should WebResource.post(ClientResponse.class, new
> MultiPart()); work?
>
Actually, it should not. Per RFC 2046, Section 5.1:

    "The [multipart] body must then contain one or more body parts ..."

I'm going to have the MessageBodyWriter throw an exception complaining
if there are no body parts at all.

But this isn't going to help your original problem. Can you
successfully run the unit tests in jersey-multipart in your environment?
> Gili
Craig