Problemas JSF não abre?

Olá, pessoal!

Estou tentando a programa JSF e configurei tudo certinho… mas ocorreu problemas veja…

Mensagem de erro


INFO: Initializing Mojarra (1.2_15-b01-FCS) for context '/Cadastro'
log4j:WARN No appenders could be found for logger (org.ajax4jsf.renderkit.ChameleonRenderKitFactory).
log4j:WARN Please initialize the log4j system properly.
28/04/2011 01:44:01 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
28/04/2011 01:44:02 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
28/04/2011 01:44:02 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/26  config=null
28/04/2011 01:44:02 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2294 ms
28/04/2011 01:44:04 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException: FacesContext is null
	at org.ajax4jsf.context.AjaxContext.getCurrentInstance(AjaxContext.java:159)
	at org.ajax4jsf.context.AjaxContext.getCurrentInstance(AjaxContext.java:144)
	at org.ajax4jsf.component.AjaxViewRoot.getViewId(AjaxViewRoot.java:588)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:104)
	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:619)

Como assim “java.lang.NullPointerException: FacesContext is null” está retornando vazio?

Posta aí o seu mapeamento do jsf…

Web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>Cadastro</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <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>*.jsf</url-pattern>
  </servlet-mapping>
</web-app>

Cadastro.jsp

<%@taglib uri="http://richfaces.org/rich" prefix="rich"%><%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1>Cadastro do Cliente</h1>
<f:view>
	<h:form id="formulario">
		<h:panelGrid id="p" columns="2">
			<h:outputLabel value="Nome:"/>
			<h:inputText immediate="true" value="#{clienteBean.nome}" id="nome" required="true" requiredMessage="Digita Algo">
				<f:validateLength minimum="5" maximum="25"/>
				<h:message for="nome" style="resd"/>
			</h:inputText>
			<h:outputLabel value="E-mail:"/>
			<h:inputText immediate="true" value="#{clienteBean.email}" id="email" required="true" >
				<h:message for="email" style="red" showSummary="true" showDetail="false"/>
			</h:inputText>
			<h:commandButton id="submit" value="Cadastro" action="#{clienteBean.IncluirCadastro }"/>
			</h:panelGrid>
	</h:form>
</f:view>
</body>
</html>