I have web project set up with MyFaces so the following JSF works:
Code: Select all
<h:outputText value="Hello1"/>
Code: Select all
<p:colorPicker ></p:colorPicker>
When I add this XML to the web.xml, I get an error ...
Code: Select all
<!-- PRIME FACES BEGIN -->
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.primefaces.ui.resource.ResourceServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/primefaces_resources/*</url-pattern>
</servlet-mapping>
<!-- PRIME FACES BEGIN -->
Code: Select all
javax.servlet.ServletException: Servlet.init() for servlet faces threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:637)
root cause
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!
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.
A typical config looks like this;
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
javax.faces.FactoryFinder.getFactory(FactoryFinder.java:106)
javax.faces.webapp.FacesServlet.init(FacesServlet.java:105)
org.apache.myfaces.webapp.MyFacesServlet.init(MyFacesServlet.java:94)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:637)
rh