• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown

Body of Request occasionally lost

Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solaris11 OS
Glassfish 2.1.1 app server
struts2 framework
A 2-way compression filter is used

When requests are sent to the application I work on, it appears that occasionally the body of the POST request is lost. I am lead to believe this because I get reports of errors that generate stack traces that all fail the at the first line of code for the action that relies on the existence of a required request parameter. This appears to happen on multiple (probably all) actions that the application handles. The problem only seems to occur once every few thousand requests or so. In an attempt to narrow down the problem I put some logging into one of the actions that is kicked off if the first required request parameter is null. In this method I attempt to log any relevant values from HttpServletRequest object, all of the http request header, all of the http request parameters, and I try to read the request as a file and write it out to the log file (although I'm not sure I'm doing that right). When I do this, what I see in the log file is that there are no request parameters but the content length is around 20K - 25K. I'm confident that the code that I wrote to write out the request parameters is correct as it works correctly when I try use it with requests that contain data. The code I wrote to write out the request read from a file doesn't seem to work, I've tried different variations but it looks something like this:

Even when there is data in the request, this just writes out:

Starting content:
ending content

I realize this isn't a lot to go on, but I'm not sure where to go with this from here. Does anyone have any ideas on this or suggestions on how to better diagnose the problem? I assume the content-length was computed by the browser and sent in the header, so feel like the fact that I have no parameters indicates that either the content didn't reach the server or that it got garbled along the way (maybe a problem with decompression or decryption?) to the point where glassfish couldn't parse it into request parameters. Let me know if you have any ideas.

Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic