users@jersey.java.net

Re: [Jersey] FormDataMultiPart, usage on server side

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Fri, 30 Jul 2010 14:45:34 +0200

Hi Boma,

You need to include the jersey multipart dependency on the server side.

   https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html
#d4e1636

Paul.

On Jul 23, 2010, at 10:36 AM, Boma Koko wrote:

> SEVERE: A message body reader for Java class
> com.sun.jersey.multipart.FormDataMultiPart, and Java type class
> com.sun.jersey.multipart.FormDataMultiPart, and MIME media type
> multipart/form-data;boundary=Boundary_1_12258573_1279872726687 was
> not found
> Jul 23, 2010 1:12:06 AM
> com.sun.jersey.spi.container.ContainerRequest getEntity
> SEVERE: The registered message body readers compatible with the MIME
> media type are:
> */* ->
> com.sun.jersey.core.impl.provider.entity.FormProvider
> com.sun.jersey.core.impl.provider.entity.StringProvider
>
>
> Hello Folks,
>
> I wonder if others have encountered this or have an explanation for
> it.
> It appears the the check for media type is incorrectly including the
> boundary specification.
>
> On the client type the type is set as:
> .type(MediaType.MULTIPART_FORM_DATA)
> response = service.path("rest")
> .path("FileUpload")
> .path("files")
> .type(MediaType.MULTIPART_FORM_DATA)
> .post(ClientResponse.class,params);
>
> FormDataMultiPart params = new FormDataMultiPart();
>
>
> It appears the injection is automatic no need for "FormDataParam"
> for each separate field.
>
> Thanks for the assistance.
> boma
>
> ___________________________
> Boma R. Koko
> Mobile +1 714 658 6915
> Skype: boma.koko
> Gtalk: boma.r.koko_at_gmail.com