Stacked Q&A

WebSphere Application Server for Liberty not finding Context-Root
  • 3 voting
  • 2022-06-26 00:00

    I’m a new starter to using Java EE to build a dynamic web project in Eclipse. At first all was going well, I could run my web project locally on my WebSphere Application Server for Liberty (version and access my webpages from


    and push to my remote server on IBM BlueMix and everything also still worked.

    During development I discovered JavaServer Faces capabilities. So I went into my project in eclipse and added the JSF facet using the Mojara 2.2 JSF Implementation library. As soon as I added the JSF facet to my project, every time I tried to run my web application locally, I would be met with a “Context Root Not Found” Error Page. Even trying to access my web pages directly (localhost:9080/MainApplication/index.html) resulted in the same error. However pushing to my remote server still works and my web project runs JSF normally, So this is leading me to believe there’s something wrong with my WebSphere Application Server configuration on my local machine.

    Reverting by removing the JSF facet from my application in Eclipse fixes the problem, and re-adding the facet re-introduces the problem. According to this link, adding a JSF facet only imports the JSF implementation library of your choice into the project, adds a “Faces configuration file” and updates your web.xml with the faces servlet configuration. So I don’t understand why adding the JSF facet is causing the server to not find the context root. Here is my web.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="" xmlns:xsi="" xsi:schemaLocation="" version="3.0">
            State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
            <servlet-name>Faces Servlet</servlet-name>
            <servlet-name>Faces Servlet</servlet-name>

    and server.xml:

    <server description="new server">
        <!-- Enable features -->
        <basicRegistry id="basic">
          <user name="admin" password="adminpwd"/>
        <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
        <httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
        <!-- Automatically expand WAR files and EAR files -->
        <applicationManager autoExpand="true"/>
        <applicationMonitor updateTrigger="mbean"/>
        <keyStore id="defaultKeyStore" password="adminpwd"/>
        <webApplication id="MainApplication" location="MainApplication.war" name="MainApplication" contextRoot="MainApplication" type=""/>

    I have tried starting a new project and adding the JSF from scratch instead of later on, and I have the same problem. I have tried adding contextRoot=”MainApplication” to my server.xml under my web Project and that also doesn’t work. If I right click on my project -> properties -> Web Project Settings -> Context root: The value is set to MainApplication. One stackoverflow post had a similar issue here: WebSphere Liberty Profile: Context Root Not Found But his fix involved some files that I do not have in my project (ibm-web-ext.xml & ibm-web-bnd.xml). Neverthless I tried creating these files in my WEB-INF directory and still didn’t work.

    I have spent the past 3 days looking for a solution and have gotten nowhere and have exhausted all my ideas. Any help is appreciated.

  • 1 6456 0 0
첨부 파일
총 1개의 답변이있습니다.
  • 답변일: 2022-06-26 00:00

    The webProfile-7.0 feature brings in the jsf-2.2 feature, so the problem might be due to the two jsf implementations. To ensure that that is not the problem, you could list each feature that webprofile provides independently, but removing jsf, so: jsp-2.3, ejbLite-3.2, managedBeans-1.0, beanValidation-1.1, servlet-3.1, ssl-1.0, jndi-1.0, jsonp-1.0, appSecurity-2.0, jdbc-4.1, jaxrs-2.0, jaxrsClient-2.0, el-3.0, json-1.0, jpaContainer-2.1, cdi-1.2, distributedMap-1.0, websocket-1.1, jpa-2.1

    Plus your two other features: adminCenter-1.0, localConnector-1.0

  • 0 0 채택된 답변 퍼블 채택!