users@jersey.java.net

Re: Multipart and OSGi

From: Ángel Eduardo <egarcia_at_swissms.ch>
Date: Wed, 25 Aug 2010 16:15:03 +0200

  Ok, it seemed that jersey-client-components (like MultiPart) were not
being loaded. I've added com.sun.jersey.multipart to my imported
packages, and revert back to 1.1.5 because 1.4-SNAPSHOT doesn't seem to
work (lot of errors with the same code)

Thanks for listening, hope this helps someone :)

-- 
Ángel Eduardo
On 25/08/2010 15:17, Ángel Eduardo wrote:
>  Hi again.
>
> sorry for bothering you again with my OSGi (mis)adventures, but now 
> I'm having a bit of trouble with multipart messages that were working 
> before the OSGification of my WAR bundle.
>
> I've a method:
>
>     @POST
>     @Consumes(MediaType.MULTIPART_FORM_DATA)
>     @Path("test")
>     public Response onTest(
>             final @FormDataParam("auth") String paramAuth,
>             final @FormDataParam("data") InputStream paramData
>             )
>     {
>         System.out.println(paramAuth);
>     }
>
> This was previously working as it should, i.e. printing the value of 
> the field "auth", but right now, it holds EVERYTHING that is sent to 
> the method, i.e., the full content from first boundary to last 
> boundary, like:
>
> ------WebKitFormBoundaryb6XbFyhZ6EVO3xBB
> Content-Disposition: form-data; name="auth"
>
> passwd:passwd
> ------WebKitFormBoundaryb6XbFyhZ6EVO3xBB
> Content-Disposition: form-data; name="data"; filename="testData"
> Content-Type: application/octet-stream
>
> datadatadatadatadata
>
> ------WebKitFormBoundaryb6XbFyhZ6EVO3xBB--
>
> Any idea of what could be wrong??
>
> Thanks a lot in advance!!
>