IBM Support

HTTP Error 500: Cannot find FacesContext

Troubleshooting


Problem

An incorrectly configured Servlet mapping or Faces extension causes an HTTP 500 error.

Cause

An incorrectly configured Servlet mapping or Faces extension.

Resolving The Problem

When a Faces Servlet mapping is created in the web.xml file, it must be mapped to a faces extension (*.jsf) as in the following example:

<servlet-mapping>

    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>

If the URL pattern in the web.xml file does not match the request URL, an HTTP 500 error will be displayed with the message: "Cannot find FacesContext ."

If the request is for index.faces but the servlet mapping is to the .jsf file extension, the HTTP 500 error will be returned. To correct this problem make sure the mapping and request URL match.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF012","label":"IBM i"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5.5;8.5;8.0;7.0;6.1;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}},{"Product":{"code":"SS7K4U","label":"WebSphere Application Server for z\/OS"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":" ","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"6.1;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21243901