2011/2/4 eurotrans-Verlag <verlag.preis...@t-online.de>:
> I noticed that when sending an invalid request to Tomcat 7.0.7 (e.g. without
> a HTTP method), Tomcat throws a NullPointerException, instead of responding
> with a "400 Bad Request".
>
> If you do a request like this for example:
>
> /invalidRequest HTTP/1.1
> Host: localhost
>
>
> Then Tomcat prints:
>
> 04.02.2011 02:16:44 org.apache.catalina.connector.CoyoteAdapter service
> SCHWERWIEGEND: An exception or error occurred in the container during the
> request processing
> java.lang.NullPointerException
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
>
> and closes the connection without sending a response.
>
> Shouldn't Tomcat respond with "400 Bad Request" instead of throwing a NPE?
> ;)
> (I don't think this is a big issue, just wanted to note that behavior.)
>

Thank you a lot. Fixed with
http://svn.apache.org/viewvc?rev=1067072&view=rev

It fixes the NPE.
Changing the code so that it actually responds with "400 Bad Request"
line instead of closing the connection will require further
investigation. It logs this request as been replied with "400" though.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to