I am getting the following error when trying to run a simple JSF page in Liberty on Bluemix
App/0
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:226)
2016-03-29T09:34:01.018-0400
App/0
A typical config looks like this;
2016-03-29T09:34:01.018-0400
App/0
<listener>
2016-03-29T09:34:01.018-0400
App/0
If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
2016-03-29T09:34:01.018-0400
App/0
at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:306)
2016-03-29T09:34:01.018-0400
App/0
at [internal classes]
2016-03-29T09:34:01.019-0400
App/0
</listener>
2016-03-29T09:34:01.018-0400
App/0
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:115)
2016-03-29T09:34:01.018-0400
App/0
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:332)
2016-03-29T09:34:01.018-0400
App/0
[ERROR ] SRVE0271E: Uncaught init() exception created by servlet [Faces Servlet] in application [myapp]: java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
2016-03-29T09:34:01.018-0400
App/0
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
2016-03-29T09:34:01.018-0400
My simple JSF page is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" >
<h:head></h:head>
<h:body>
Inside the define content template
<h:outputText value="My Fit Account @ PNC JSF"/>
<h:outputText value="Testing JSF in BlueMix"/>
</h:body>
</html>
And my Faces configuration in web.xml is as follows:
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
I have made no changes to the default setup of Liberty on Bluemix so I believe it should have JSF2.2 loaded. I have tried setting up the listener as described in the error message, but it did not resolve the issue.