users@jersey.java.net

Multipart and OSGi

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

  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!!

-- 
Ángel Eduardo