Servlet Faces Servlet is not available (richfaces

2020-04-19 06:10发布

问题:

I am trying out my first richfaces project. So I created a new JSF project (using JBoss Tools eclipse plugin) with the following options selected:

  • JSF2.0
  • JSFKickStartWithoutLibs

I did no changes to generated sample.The exported WAR file contains the following libraries

  /WEB-INF/lib/common-annotations.jar   
  /WEB-INF/lib/commons-beanutils.jar  
  /WEB-INF/lib/commons-collections.jar 
  /WEB-INF/lib/commons-digester.jar  
  /WEB-INF/lib/commons-logging.jar  
  /WEB-INF/lib/cssparser-0.9.5.jar  
  /WEB-INF/lib/guava-r09.zip  
  /WEB-INF/lib/richfaces-components-api-4.0.0.Final.jar  
  /WEB-INF/lib/richfaces-components-ui-4.0.0.Final.jar  
  /WEB-INF/lib/richfaces-core-api-4.0.0.Final.jar  
  /WEB-INF/lib/richfaces-core-impl-4.0.0.Final.jar  
  /WEB-INF/lib/sacjava-1.3.zip  
  /WEB-INF/lib/standard.jar 

I then deployed to WAR to Tomcat with no errors. But launching the application (the index.html redirects to /pages/inputname.jsf correctly) it results in the following error on web browser. There are no errors in catalina.out

HTTP Status 404 - Servlet Faces Servlet is not available

type Status report

message Servlet Faces Servlet is not available

description The requested resource (Servlet Faces Servlet is not available) is not available.

Since I made no changes to the generated sample project, I guess there are some missing libraries. Please help me resolve this issue.

回答1:

You need to bundle JSF implementation jars viz. jsf-api.jar and jsf-impl.jar inside your WEB-INF\lib (Either Mojarra or MyFaces), since Tomcat does not come bundled with JSF jars



回答2:

The project is missing JSF jars. I believe project based on 'JSFKickStartWithoutLibs' template is intended to be run on JBoss AS - which already comes with JSF jars.