users@jersey.java.net

Re: [Jersey] Jersey, Jmeter and multipart

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Thu, 23 Sep 2010 09:59:12 -0700

Hi,

Can you enable logging:

   https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/LoggingFilter.html

and email the log from the server, from when Jersey initiates up to
and including when it responds with an error for the multipart/form-
data request from JMeter.

I want to see the exact request that JMeter is sending so i can
determine if this is an issue with the Jersey multipart processing.
The error indicates that the part you are accessing declares a media
type other than text/plain.

Paul.




On Sep 23, 2010, at 3:50 AM, EZZAT Mani wrote:

> Sorry to insist again :-(
> Spent the last few days trying to solve this, but I can't make it
> work :(
> Does anyone have an idea ?
>
> On Monday 20 September 2010 21:22:36 mani.ezzat_at_neuf.fr wrote:
>> Hello,
>>
>> I've got a problem but i'm not sure it's a jersey problem.
>>
>> I've got a webapp using Jersey. Server side, i have two methods.
>> One for
>> url encoded request, and an other for a file AND the same
>> parameters of
>> the url encoded one.
>>
>> My problem is concerning the second method (a POST)
>> I use a multipart/form mediaType with a field named "file"
>> containing the
>> uploaded file. The other fields are string param
>>
>> When I use a browser everything is fine. Same if I use a java
>> client (which
>> use Jersey)
>>
>> But when I use Jmeter i've got an Exception.
>> I'm not at work so i can't past it. But it's about the getValue
>> method of
>> the bodypart class. It says thats the content must be text/plain
>> (like
>> written in the javadoc)
>>
>> I looked at the request done by Jmeter and by a browser.
>> It's the same except for one thing :
>> Jmeter sends a content-transfer-encoding: 8 bits for each field of
>> the
>> multipart form, and binary for the file.
>>
>> I can't change that behaviour in Jmeter. According to some RFC
>> specif,
>> Jmeter seems to be right. My question is : is this really a Jersey
>> thing ?
>> and how can I make my app (server side) handle those requests ? I
>> tried
>> getEntityAs and getValueAs and i got another exception which says
>> that de
>> content isn't the unconverted entity (as writter in the javadoc too)
>>
>> To make it "simple", I have server side a method like this :
>>
>> @consume "multipart/form"
>> getform(FormDataMultipart form){
>> form.getField("my param").getValue()
>> }
>> and it sends the text/plain exception on getvalue (only if it's a
>> jmeter
>> request)
>>
>> I'm using jersey 1.1.1 (i have also the multipart contrib,
>> mimepull.jar
>> etc... well it works but not with Jmeter request)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>