Hi all,
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)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
11Protocol.java:188)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
11Protocol.java:166)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:
288)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)
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.)
Cheers
Konstantin Preißer
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]