users@jersey.java.net

Re: [Jersey] multipart/form-data error consuming error <was> Re: [Jersey] Variable changes do not happen

From: Muhra Daniel <daniel.muhra_at_googlemail.com>
Date: Wed, 9 Jun 2010 01:15:54 +0200

Hi,

Sorry for the late reply, but currently I'm very busy.
I tried to invoke the logger, but I haven'T found out, how to redirect the output to a file. For the console, the output is currently too much.

I also noticed that smaller images (4Kb gif converted to TIF) seem to be acceptable for the server. But still the File representation seems to be invalid.
Bigger files trigger an error on the server side, saying the request is syntactically incorrect.

But for now, can someone tell me how to redirect the logger output to a file. I invoked it by:

     <init-param>
         <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
         <param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
     </init-param>
     <init-param>
         <param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
         <param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
     </init-param>

Cheers,
Daniel

Am 07.06.2010 um 13:32 schrieb Paul Sandoz:

> Hi Daniel,
>
> Can you enable server-side logging:
>
> https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/LoggingFilter.html
>
> I would like to see the all of the client request, including the headers.
>
> What version of Jersey are you using?
>
> What is the log output from the server side?
>
> Paul.
>
> On Jun 7, 2010, at 1:16 AM, Muhra Daniel wrote:
>
>> Hi,
>>
>> Currently I'm trying to upload an image to my server. Unfortunately the server denies to accept the request, claiming it's syntactically incorrect.
>> A usual request would look like this:
>>
>>
>> --0xKhTmLbOuNdArY
>> Content-Disposition: form-data; name="login"
>>
>> peer
>> --0xKhTmLbOuNdArY
>> Content-Disposition: form-data; name="password"
>>
>> reep
>> --0xKhTmLbOuNdArY
>> Content-Disposition: form-data; name="image"; filename="file"
>> Content-Type: application/octet-stream
>>
>> MM
>> $ннн
>> ...
>> н
>> 
>> --0xKhTmLbOuNdArY--
>>
>> The service which is invoked is defined as follows:
>>
>> @POST
>> @Consumes( MediaType.MULTIPART_FORM_DATA )
>> @Produces(MediaType.TEXT_PLAIN)
>> public String uploadImage(@FormParam("login") String login, @FormParam("password") String password, @FormParam("image") File image) {
>> ... process file...
>> }
>>
>>
>> The question now is, where the error lies. Is my service wrong (most likely), or is the POST request somehow incorrect. The request is made using a framework called ASIHTTPRequest. I also tried to use byte[] instead of file, but that doesn't work either.
>> Every help is appreciated.
>>
>> Cheers,
>> Daniel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>