If the directory/file paths specified in this guide do not exist in your WSO2 product, see Directory Structure of WSO2 Products to locate the paths applicable to your product.

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


You can customize the above error message by following the instructions given below.

  1. Download and install Apache Maven.

  2. Create a Maven project using your IDE.

  3. Create a directory named resources inside the <PROJECT_HOME>/src/main/ directory, and then create another directory named web inside it.


    <PROJECT_HOME> denotes the top-level directory of your Maven project.

  4. Create a new HTML error page (e.g. new_ error_404.html file) as shown below. This contains the customized error page.

    Code Block
        	<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
        	<title>404 - Error not found</title>
    		<h1>Sorry, this resource is not found.</h1>
  5. Add the new_ error_404.html  file inside the <PROJECT_HOME>/src/main/web directory.
  6. Add the following property below the <version> element in the <PROJECT_HOME>/pom.xml file: <packaging>bundle</packaging>

  7. Add the following configurations inside the <plugins> element in the <PROJECT_HOME>/pom.xml file.

    Code Block
  8. Add the following configurations inside the <dependencies> element in the <PROJECT_HOME>/pom. xml file:

    Code Block
  9. Build the Maven project by executing the following command: mvn clean install

  10. Once the project is built, copy the JAR file (from the <PROJECT_HOME>/target/ directory) to the <CARBON_HOME>/repository/components/dropins/ directory.
  11. Change the following configurations in the <CARBON_HOME>/repository/conf/tomcat/carbon/WEB-INF/web.xml file.

    Code Block

    You need to replicate this configuration, and change the values of the <error-code> and <location> elements accordingly for each new HTML error page you add.

  12. Restart the WSO2 Carbon server.
  13. Access the following URL again, to test the error page you customized:
    You will view the new error page with the following content: "Sorry, this resource is not found."