users@jersey.java.net

Re: [Jersey] Re: Multipart and OSGi

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

  Thank you a lot, Paul. I'll be waiting for your fix, since with 1.1.5,
Jersey is throwing the dreaded "A message body writter for Java type...
and mime application/xml" that was working fine before with
1.4-SNAPSHOT, so I'll try with your fix.

Thanks a lot again!

On 25/08/2010 16:29, Paul Sandoz wrote:
> Hi Ángel,
>
> I think you are hitting a bug in the multipart stuff is being
> discussed in another thread:
>
> http://markmail.org/search/?q=list%3Anet.java.dev.jersey.users#query:list%3Anet.java.dev.jersey.users+page:2+mid:bhrndjhcr7r5hauu+state:results
>
>
> i have a fix locally that i will commit today.
>
> Paul.
>
> On Aug 25, 2010, at 4:15 PM, Ángel Eduardo wrote:
>
>> 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!!
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>


-- 
Ángel Eduardo
egarcia_at_swissms.ch