We are sending uploaded file (image,pdf, etc) to the server to be saved in the database.
The file is Base64 encoded and sent as XML field, i.e.
<?xml version="1.0" ?> <Request> <Binary_File>R0lGODlhkA....long Base64 string....s=</Binary_File> </Request>
While sending this XML as POST parameter it's truncated,
i.e. when we get the parameter in the HttpServletRequest.getParameter method the result looks like this:
<?xml version="1.0" ?> <Request> <Binary_File>R0lGODlhkA....long Base64 string...9g0l1Pv9/n8
Exactly the same problem occurs on WildFly 8.0.0.Final and WildFly 8.1.0.Final and never on JBoss5.
It’s looks like the problem is related to timing: on our development server the problem to success ratio is ~ 14/6. When we run apache and mod_jk in debug mode the ratio was swapped, i.e. 14 successful / 6 failed requests. On production servers almost all of the requests failed (even with apache and mod_jk debug mode enabled).
Output of the mod_jk (saved as TCP dump) for both successful and failed request is exactly the same.
When comparing the successful and failed data received by server (server_dump_OK.txt and server_dump_ERROR.txt) we see that in failed case the block before the last one is inserted twice, i.e. in success we see blockX+last block; in failed – blockX+blockX.