Hitachi

uCosminexus Application Server Compatibility Guide


C.1 Error status codes returned by the Web container

When the client accesses a non-existent resource or a servlet in which an exception occurred, the Web container returns an error status code. The following table describes the error status codes returned by the Web container, and the conditions for returning the error status codes.

Table C‒2: Error status codes returned by the Web container and conditions for returning the error status codes

Error status codes

Conditions for returning the error status code

400 Bad Request

Error status code 400 is returned when any of the following conditions are met:

  • When a client directly sends a request to a resource that is specified as the login page used for Form authentication, and the user is successfully authenticated from the login page that is displayed as a result of the request

  • When the access satisfies all the following three conditions:

  1. The version of HTTP is "HTTP/1.0".

  2. The servlet to be accessed inherits javax.servlet.http.HttpServlet.

  3. The HTTP method at the access is not overwritten by the servlet.

  • When an access is made by a request header with a Content-Length header value of greater than 2147483647 or smaller than 0

  • When an access is made by a request header with a non-numeric Content-Length header value

  • When an access is made by a request header containing multiple Content-Length headers

  • When request URIs cannot be normalized

401 Unauthorized

The error status code 401 is returned when a resource that requires Basic authentication is accessed as follows:

  • The access uses an invalid user ID or password.

  • The access does not include authentication information (the Authorization header).

403 Forbidden

Error status code 403 is returned when any of the following conditions are met:

  • When a resource that requires the Basic or Form authentication is accessed using an unauthenticated user name

  • When a resource that does not permit any access is accessed without any role-name element for the auth-constraint element being specified in web.xml#1

  • When static contents are accessed by using the PUT or DELETE method

  • When a resource whose <transport-guarantee> element in web.xml is set to INTEGRAL or CONFIDENTIAL is accessed via http#2

404 Not Found

Error status code 404 is returned when any of the following is accessed:

  • When a non-existent resource is accessed

  • When a servlet or a JSP file in which javax.servlet.UnavailableException occurs, is accessed#3

405 Method Not Allowed

Error status code 405 is returned in the case of an access that satisfies all of the following three conditions:

  • When the HTTP version is "HTTP/1.1"

  • When the servlet to be accessed inherits javax.servlet.http.HttpServlet

  • When the HTTP method during access does not get overridden by the corresponding servlet

412 Precondition Failed

Error status code 412 is returned, when the static contents that do not match the conditions specified in If-Match header or If-Unmodified-Since header, are accessed.

413 Request Entity Too Large

Error status code 413 is returned when the size of the request body exceeds the upper-limit value.

416 Requested Range Not Satisfiable

Error status code 416 is returned, when the static contents that use the value of an invalid Range header applicable to any of the following cases, are accessed:

  • The value of Range header does not begin with "byte"

  • A numeric character and "-" is not used in range definition

  • The specified range is not appropriate

500 Internal Server Error

Error status code 500 is returned when any of the following conditions are met:

  • When a servlet or a JSP file in which an exception occurs, is accessed#4

  • When a JSP file whose compilation failed is accessed

  • When deleted static contents are accessed#5

  • When I/O error occurs when accessing the static contents

  • When a resource protected by <auth-constraint> element is accessed, when the definition of web.xml is invalid#6

501 Not Implemented

Error status code 501 is returned, when the static contents or the servlet that inherits javax.servlet.http.HttpServlet is accessed by an HTTP method other than the GET, HEAD, POST, PUT, DELETE, OPTIONS, and TRACE method.

503 Service Unavailable

Error status code 503 is returned when any of the following conditions are met:

  • When there is no space in the pending queue of requests#7

  • When a servlet or JSP file in which javax.servlet.UnavailableException occurs, is accessed#8

  • When a Web container being shut down is accessed

  • When a Web application that is in abnormal state due to an unexpected error or exception, is accessed

#1

Applicable when the Web application is version 2.4 or later.

#2

This applies to the case when the port number of the https, used by the URL an access is forwarded to, is not set for the webserver.connector.redirect_https.port key in usrconf.properties.

#3

Applicable when the version of the Web application is 2.4 or later, and javax.servlet.UnavailableException indicating the permanent unavailability occurs, and the exception is not caught in the servlet and JSP file.

#4

Applicable in the following cases:

#5

Applicable when the reload functionality of the Web application, re-compilation functionality of the JSP file, or the reload functionality of J2EE application is not used.

#6

Applicable when the <role-name> element is defined in the <auth-constraint> element of web.xml, and the <login-config> element is not defined. If the application is started in this state, warning message KDJE39150-W is output to the console window, and in the message log.

#7

Applicable when the settings to control the number of concurrently executing threads in the Web application, or in the URL group are specified.

#8

Applicable in the following cases: