1

I have a web application that interacts with a DB via a Java Servlet using HTTP-Post requests (initially used GET but the length of the requests forced me to switch to the POST method).

I'm getting a 400 status and can't find the reason:

  1. I'm issuing several different requests to the DB, all work fine till I reached a large one (12K JSON string) which is preventing me from proceeding,

  2. I checked the structure of the JSON and it looks OK (I'm using this great site).

The DB properly handles the received JSON when invoked within the DB.

Logs files (TOMCAT) do not show anything specific.

How can I find what the problem could be? Right now I don't even know what to ask.

1 Answer 1

1

I finally found the problem. There was an error message within one of TOMCAT's logs that I missed claiming that the size of the header was too big. I simply changed the configuration of tomcat (server.xml) to:

  <Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           maxHttpHeaderSize="200000"
           maxPostSize="0"
           redirectPort="8443" />

[note the max size of the header]

Sign up to request clarification or add additional context in comments.

1 Comment

What log was it in? I am seeing 400 errors, but no explanation as to why they are happening

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.