Bug 44808 - HTTP Proxy does not support content type application/x-java-serialized-object
HTTP Proxy does not support content type application/x-java-serialized-object
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.3.1
PC All
: P1 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-04-11 07:35 UTC by Oliver Küsters
Modified: 2008-05-29 10:12 UTC (History)
2 users (show)



Attachments
eclipse Project Cient Side (Main, part 1/3) (615.72 KB, application/zip)
2008-04-21 06:52 UTC, hl
Details
eclipse Project Cient Side (part 2/3) (900.00 KB, application/octet-stream)
2008-04-21 06:52 UTC, hl
Details
eclipse Project Cient Side (part 3/3) (900.00 KB, application/octet-stream)
2008-04-21 06:53 UTC, hl
Details
eclipse Project Server Side (Main, part 1/3) (562.86 KB, application/zip)
2008-04-21 06:54 UTC, hl
Details
eclipse Project Server Side (part 2/3) (900.00 KB, application/octet-stream)
2008-04-21 06:54 UTC, hl
Details
eclipse Project Server Side (part 3/3) (900.00 KB, application/octet-stream)
2008-04-21 06:55 UTC, hl
Details
Readme: Installation procedure for my sample client/server application (6.83 KB, text/plain)
2008-04-21 06:58 UTC, hl
Details
Second Try Client Side: Small Archive (only spring.jar in "lib" dir has to be added) (774.04 KB, application/zip)
2008-04-24 12:05 UTC, hl
Details
Second Try Server Side: Small Archive (only spring.jar in "lib" dir has to be added) (721.17 KB, application/zip)
2008-04-24 12:06 UTC, hl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Küsters 2008-04-11 07:35:16 UTC
I wanted to use JMeter for recording HTTP traffic of a rich client applying the Spring's HTTPinvoker infrastructure.
Sending this traffic through the JMeter proxy alters the HTTP POST resquest's body inappropriately.
At the server the Spring Dispatcher Servlet bails out with a java.io.StreamCorruptedException and the content-length header indicates a larger size than sent by the client, e.g. 361 bytes instead of 340.

Browsing through the JMeter Proxy code, the HttpRequestHdr class appears biased towards string-like POST bodies imposing the inappropriate body modification, see
            // Use default encoding
            postData = new String(rawPostData);

Same with the HTPSamplerBase class and its subclasses which do not handle true byte streams correctly.
Comment 1 Sebb 2008-04-11 07:46:44 UTC
Is there a public server to test against?
Comment 2 hl 2008-04-21 06:52:04 UTC
Created attachment 21835 [details]
eclipse Project Cient Side (Main, part 1/3)

this is a spliited ZIP archive.
Comment 3 hl 2008-04-21 06:52:48 UTC
Created attachment 21836 [details]
eclipse Project Cient Side (part 2/3)

This is a part of splitted ZIP archive.
Comment 4 hl 2008-04-21 06:53:26 UTC
Created attachment 21837 [details]
eclipse Project Cient Side (part 3/3)
Comment 5 hl 2008-04-21 06:54:03 UTC
Created attachment 21838 [details]
eclipse Project Server Side (Main, part 1/3)

This is main part of a splitted ZIP archive.
Comment 6 hl 2008-04-21 06:54:35 UTC
Created attachment 21839 [details]
eclipse Project Server Side (part 2/3)
Comment 7 hl 2008-04-21 06:55:08 UTC
Created attachment 21840 [details]
eclipse Project Server Side (part 3/3)
Comment 8 hl 2008-04-21 06:58:03 UTC
Created attachment 21841 [details]
Readme: Installation procedure for my sample client/server application
Comment 9 hl 2008-04-21 07:11:39 UTC
Hi,

I have uploaded a small client/server application as a sample for you. A small service in a "hello world"-style for deployment within an application server (e.g. tomcat 4.1 or WebLogic) and a client application to invoke this mini-service.

Please refer to the attachment " Readme: Installation procedure for my sample client/server application". It includes the description how to set up the test case.

The key  point with this test case is, that you can choose if a proxy Server should be used on the client side:

a) If no proxy server is used, the content-length of the HTTP request is the same on the side of the sender/client and on the side of the receive/server.

b) if a proxy server is used (and configured properly), the content-length is _not_ equal on both sides. In my opinion, this seems to be a bug within JMETER, because the content-length is the same on both sides when using another proxy server (e.g. from grinder-3.0.1).


If you have problems with the setup of this test case application, I would be happy to help you.
 
Best wishes,
Markus
Comment 10 Sebb 2008-04-24 11:54:36 UTC
I'm unable to read the "splitted" zip files - I can see the contents list, but can't extract everything.

Please can you upload "normal" zip files; if you want to make them smaller, then exclude the generated class files and jar files, i.e. only include the source.
Comment 11 hl 2008-04-24 12:05:25 UTC
Created attachment 21849 [details]
Second Try Client Side: Small Archive (only spring.jar in "lib" dir has to be added)
Comment 12 hl 2008-04-24 12:06:10 UTC
Created attachment 21850 [details]
Second Try Server Side: Small Archive (only spring.jar in "lib" dir has to be added)
Comment 13 hl 2008-04-24 12:07:55 UTC
Hi,

Thank you for your quick answer.

okay, I have thrown out the spring.jar archive from the "lib" subdirectories in both eclipse projects for client and server side. You will have to add them there.
Comment 14 Sebb 2008-04-24 17:03:17 UTC
I've now been able to extract the test application, and can see the issue you reported.

Part of the problem seems to be that the HTTP Samplers don't really have provision for sending binary data (except as part of a file).

The data currently has to be saved as a nameless parameter.
It looks like the value is being changed unnecessarily.
Not sure how easy this is going to be to fix.
Comment 15 Sebb 2008-05-02 07:14:58 UTC
Note that the Proxy is intended for recording *browser* sessions - as far as I know, this scenario cannot be reproduced with a browser.

But if a way can be found to fix it without breaking anything else ...
Comment 16 Sebb 2008-05-28 16:19:42 UTC
SVN updated:

URL: http://svn.apache.org/viewvc?rev=661141&view=rev
Log:
Bugs 44808 & 39641 - Proxy support for binary requests

The night build has the fix - please report any problems.
Comment 17 hl 2008-05-29 05:57:57 UTC
Dear Sebb,

Thank you very much for your bugfix.

I tested the fix with my local installation successfully, so the bug is fixed.

Thank you!
Markus

Comment 18 Bruno Ghisi 2008-05-29 10:12:32 UTC
Loved that! Congratulations! This is awesome! I have tested and worked perfeclty!