IBM Support

Disable Keep Alive for Java Client in IBM HTTP Server to avoid POST upload failures

Troubleshooting


Problem

Client POST Requests from User-Agent: Java1.6.0.02 client may intermittently fail due to a previous idle keep alive connection being closed by the IBM HTTP Server. It is normal for the web server to close an idle keep alive connection after KeepAliveTimeout fires (default 15 seconds). It is not normal behavior for a client to send an HTTP request over a previously closed connection. The Java client may eventually retry the same POST request again over a new connection, but the retried request fails because the request is missing the POST body data.

Symptom

[23/Feb/2012:16:35:30 +0530] "POST /example HTTP/1.1" 200 -

If Loglevel="Trace" is enabled in the plugin-cfg.xml, the http_plugin.log will typically report the following message indicating it failed to read the body data as well

[Thu Feb 23 16:43:29 2012] 00000289 00000004 - TRACE: mod_was_ap20_http:
cb_read_body: Failed to read the full body from the browser. just_read =
0 of the expected 2677

[Thu Feb 23 16:43:29 2012] 00000289 00000004 - TRACE: lib_htrequest:
htrequestSetError: Setting the error to: |READ_FAILED|(1, Line: 1625)

[Thu Feb 23 16:43:29 2012] 00000289 00000004 - WARNING: ws_common:
websphereExecute: Error reading post data from client

Cause

This Java client is not able to properly detect when a keep alive connection is closed by the web server and may send a POST request over this already closed connection. The Java1.6.0.02 client may eventually detect the closed keep alive connection and open a new connection and retry the same POST again, but will only send the POST headers the second time and no body data.

Resolving The Problem

The Java client should properly detect when a keep alive connection is closed and not try to submit any additional requests over this already closed connection.

To workaround the problem related to this particular Java client, use the BrowserMatch directive in /IHS root/conf/httpd.conf file to disable keep alive connections for this Java client.

BrowserMatch "Java1.6.0.02" nokeepalive

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"General","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.0;7.0;6.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21590497