Chris, this code is giving me the exception:
MultiPart multipart = new MultiPart();
WebResource videos = client.resource(videosUri);
ClientResponse response = videos.post(ClientResponse.class, multipart);
Clearly I am not doing anything fishy here. It almost sounds to me like
something is wrong in Jersey itself, not my code. How do I know what
providers jersey-client has registered? The server lists them on startup but
the client does not.
Gili
Gili wrote:
>
>
> This doesn't make any sense. I ran a diff and as far as I can tell I
> didn't change anything substantial in in my code. And no, I am not
> setting the media type on any body-part, I am just invoking:
>
> BodyPart dataPart = new BodyPart();
> dataPart.getHeaders().add("Content-Disposition", "inline; name=data");
> dataPart.setEntity(videoVersion.getData());
> multipart.bodyPart(dataPart);
>
> and getData() in this case returns byte[].
>
> Gili
>
> Craig McClanahan (via Nabble) wrote:
>> Gili wrote:
>>
>> > I don't remember what I changed in the past two days but all of a
>> sudden I am
>> > getting this exception:
>> >
>> > ClientHandlerException: A message body writer for Java type, class
>> > com.sun.jersey.multipart.MultiPart, and MIME media type,
>> > application/octet-stream, was not found
>> >
>> > when invoking WebResource.post(ClientResponse.class, multipart). This
>> should
>> > be working, right?
>> >
>> > Gili
>> >
>> Only if you provide a MessageBodyWriter that knows how to handle
>> "application/octet-stream" (I presume you must be setting this media
>> type on one of your body parts). None of the default ones do.
>>
>> Craig
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1646581&i=0>
>> For additional commands, e-mail: users-help@...
>> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1646581&i=1>
>>
>>
>>
>> ------------------------------------------------------------------------
>> This email is a reply to your post @
>> http://n2.nabble.com/ClientHandlerException%3A-A-message-body-writer-for-Java-type%2C-class-com.sun.jersey.multipart.MultiPart%2C-and-MIME-media-type%2C-application-octet-stream%2C-was-not-found-tp1646521p1646581.html
>> You can reply by email or by visting the link above.
>>
>
>
--
View this message in context: http://n2.nabble.com/ClientHandlerException%3A-A-message-body-writer-for-Java-type%2C-class-com.sun.jersey.multipart.MultiPart%2C-and-MIME-media-type%2C-application-octet-stream%2C-was-not-found-tp1646521p1646640.html
Sent from the Jersey mailing list archive at Nabble.com.