views:

144

answers:

3

I'm troubleshooting a java app where XML is sent between two systems using HTTP POST and a servlet. I suspect that the problem is that the XML is growing way to big. Is it possible that this is the problem? Is there a limit?

When it doesn't work, the request.getParameter("message") on the consumer side will return null.

Both apps are running on tomcat

For instance, an XML document of size 1.73mb will not make it through..

+1  A: 

There is no defined maximum size for HTTP POST requests. If you notice such a limit then it's an arbitrary limitation of your HTTP Server/Client.

You might get a better answer if you tell how big the XML is.

dbemerlin
+6  A: 

As per http://tomcat.apache.org/tomcat-6.0-doc/config/http.html the default is 2 MB for your <Connector>.

maxPostSize = The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).

Edit Tomcat's server.xml. In the <Connector> element, add an attribute maxPostSize and set a larger value (in bytes) to increase the limit.

Having said that, if this is the issue, you should have got an exception on the lines of Post data too big in tomcat

See here http://stackoverflow.com/questions/123335/what-causes-java-lang-illegalstateexception-post-too-large-in-tomcat-mod-jk

JoseK
Thanks for your answer. I managed to get it working. I did not get any exceptions, but for what I know, it might have been caught somewhere inside this legacy dungeon
l3dx
+1  A: 

There may be a limit depending on server and/or application configuration. For example, see http://support.microsoft.com/kb/942074/

František Žiačik