tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 50734] New: 400 Bad Request when there are no web applications deployed on Tomcat 6.0.32
Date Tue, 08 Feb 2011 16:15:03 GMT

           Summary: 400 Bad Request when there are no web applications
                    deployed on Tomcat 6.0.32
           Product: Tomcat 6
           Version: 6.0.32
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina


I have the following use case:
I have no web applications deployed on Tomcat. 
Nevertheless when I request a web application: http://localhost:8080/testapp
Instead of the expected 404 Not Found I'm receiving 400 Bad Request.

This scenario is tested on 6.0.32 and 7.0.8, it is working as expected on

While searching the code for both versions, I can see that in 7.0.8 you have
the following:

org.apache.catalina.connector.CoyoteAdapter.postParseRequest(Request, Request,
Response, Response)
            // If there is no context at this point, it is likely no ROOT
            // has been deployed
            if (request.getContext() == null) {
                res.setMessage("Not found");
                // No context, so use host
                request.getHost().logAccess(request, response, 0, true);
                return false;

In the 6.0.32 version of the same class there is no such statement. When
entering org.apache.catalina.core.StandardEngineValve.invoke(Request, Response)
        if (host == null) {


the host is null because the context is null. So 400 Bad Request is returned.

Could you please introduce the check from Tomcat 7.0.8 in Tomcat 6.0.x. I think
that 404 Not Found is more appropriate for this use case and not 400 Bad
Request. The 400 status code typically is returned in case the request cannot
be fulfilled due to bad syntax.

Thanks in advance
Best Regards
Violeta Georgieva

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message