JSF - Erro:No FacesContext is available to process this request. This is most likely due to the req

ola pessoal
eu tinha uma pagina rodando em jsf 1.1 e richfaces 3.0
porem, preciso usar alguns componentes do richfaces 3.2 e fiz as atualizacoes, so que depois que fiz isso, eu tenho o sequinte erro na pagina

HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: java.lang.IllegalStateException: No FacesContext is available to process this request.  This is most likely due to the request being sent to the wrong path.
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause 

java.lang.IllegalStateException: No FacesContext is available to process this request.  This is most likely due to the request being sent to the wrong path.
	com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:159)
	org.apache.jsp.pessoabusca_jsp._jspx_meth_f_005fview_005f0(pessoabusca_jsp.java:105)
	org.apache.jsp.pessoabusca_jsp._jspService(pessoabusca_jsp.java:81)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.16

e no TomCat esse erro

27/04/2008 21:23:58 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:PreCadastro_V2' did not find a matching property.
27/04/2008 21:23:58 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Arquivos de programas\Java\jre1.6.0_04\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Arquivos de programas\Java\jre1.6.0_04\bin\client;C:\Arquivos de programas\Java\jre1.6.0_04\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Arquivos de programas\Microsoft SQL Server\80\Tools\Binn\;C:\Arquivos de programas\Microsoft SQL Server\90\DTS\Binn\;C:\Arquivos de programas\Microsoft SQL Server\90\Tools\binn\;C:\Arquivos de programas\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Arquivos de programas\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\
27/04/2008 21:23:58 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
27/04/2008 21:23:58 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 535 ms
27/04/2008 21:23:58 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
27/04/2008 21:23:58 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
27/04/2008 21:23:58 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Sun's JavaServer Faces implementation (1.2-b20-FCS) for context '/PreCadastro_V2'
27/04/2008 21:24:00 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Completed initializing Sun's JavaServer Faces implementation (1.2-b20-FCS) for context '/PreCadastro_V2'
27/04/2008 21:24:00 org.ajax4jsf.cache.CacheManager getCacheFactory
INFO: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
27/04/2008 21:24:00 org.ajax4jsf.cache.LRUMapCacheFactory createCache
INFO: Creating LRUMap cache instance using parameters: {org.ajax4jsf.SKIN=blueSky}
27/04/2008 21:24:00 org.ajax4jsf.cache.LRUMapCacheFactory createCache
INFO: Creating LRUMap cache instance of default capacity
27/04/2008 21:24:00 org.ajax4jsf.cache.CacheManager getCacheFactory
INFO: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
27/04/2008 21:24:00 org.ajax4jsf.cache.LRUMapCacheFactory createCache
INFO: Creating LRUMap cache instance using parameters: {org.ajax4jsf.SKIN=blueSky}
27/04/2008 21:24:00 org.ajax4jsf.cache.LRUMapCacheFactory createCache
INFO: Creating LRUMap cache instance of default capacity
27/04/2008 21:24:00 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
27/04/2008 21:24:01 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
27/04/2008 21:24:01 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/47  config=null
27/04/2008 21:24:01 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2750 ms
27/04/2008 21:24:01 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: No FacesContext is available to process this request.  This is most likely due to the request being sent to the wrong path.
	at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:159)
	at org.apache.jsp.pessoabusca_jsp._jspx_meth_f_005fview_005f0(pessoabusca_jsp.java:105)
	at org.apache.jsp.pessoabusca_jsp._jspService(pessoabusca_jsp.java:81)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	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:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	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:286)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Unknown Source)

uma curiosidade é, na URL ele me mostra o seguinte

http://localhost:8080/PreCadastro_V2/pessoabusca.jsp

e se eu modificar a pagina para

http://localhost:8080/PreCadastro_V2/pessoabusca.jsf

ele me mostra a pagina “corretamente”
mas, como ao chamar os metodos ele procura a *.jsf eu nao consigo fazer funcionar direito

estou usando as segiuntes libs
commons-beanutils.jar (versao 1.7.0)
commons-collections-3.2.1.jar
commons-digester-1.8.jar
commons-logging-1.1.1.jar
jsf-api.jar (versao jsf 1.2)
jsf-impl.jar (versao jsf 1.2)
jstl.jar
richfaces-api-3.2.0.SR1.jar
richfaces-impl-3.2.0.SR1.jar
richfaces-ui-3.2.0.SR1.jar

Server
TomCat 6.0.16

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" version="2.5">
<display-name>PreCadastro_V2</display-name>
  <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>
  
  <session-config>
    <session-timeout>10</session-timeout>
  </session-config>
  
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
<!--  rich faces -->
<context-param>
  <param-name>org.ajax4jsf.SKIN</param-name>
  <param-value>blueSky</param-value>
</context-param>

<filter>
  <display-name>Ajax4jsf Filter</display-name>
  <filter-name>ajax4jsf</filter-name>
  <filter-class>org.ajax4jsf.Filter</filter-class>
</filter>

<filter-mapping>
  <filter-name>ajax4jsf</filter-name>
   <servlet-name>Faces Servlet</servlet-name>
   <dispatcher>REQUEST</dispatcher>
   <dispatcher>FORWARD</dispatcher>
   <dispatcher>INCLUDE</dispatcher>
</filter-mapping>
 
</web-app>

faces-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
                              "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
 <navigation-rule>
  <display-name>pessoabusca</display-name>
  <from-view-id>/pessoabusca.jsp</from-view-id>
  <navigation-case>
   <from-outcome>form</from-outcome>
   <to-view-id>/pessoaform.jsp</to-view-id>
  </navigation-case>
 </navigation-rule>
</faces-config>

pessoabusca.jsp

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<f:view>	
	<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
			<link href="css/css_azul.css" rel="stylesheet" type="text/css">
			<link href="css/css_azul_form.css" rel="stylesheet" type="text/css">
			<link href="css/css_azul_tbl.css" rel="stylesheet" type="text/css">	
	<title>Busca de Pessoa</title>
	</head>
	<body>
		<div class="ContainerForm">
		
			<span class="TituloBarraEsq">&nbsp;</span>
			<span class="TituloBarra"><h1>Busca de Pessoa</h1></span>
			<span class="TituloBarraDir">&nbsp;</span>		
			<h:form>
				<fieldset>
					<span style="width:210px">	<h:outputLabel value="Nome: " for="nome"></h:outputLabel><h:inputText id="nome" maxlength="30" size="30" styleClass="FormCampo" ></h:inputText></span>
						<span style="width:115px">	<h:outputLabel value="Pessoa: " for="tipoId"></h:outputLabel>
							<h:selectOneMenu id="tipoId" styleClass="FormCampo">
								<f:selectItem itemValue="0" itemLabel="" />				
								<f:selectItem itemValue="1" itemLabel="Fisica" />
								<f:selectItem itemValue="2" itemLabel="Juridica" />
							</h:selectOneMenu> 
						</span>            			
			            <span style="width:185px">	<h:outputLabel value="CPF/CNPJ: " for="docCPF"></h:outputLabel> <h:inputText id="docCPF"  maxlength="20" size="21" styleClass="FormCampo"></h:inputText> </span>
			        	<span style="width:180px">	<h:outputLabel value="Status: " for="statusId"></h:outputLabel>
							<h:selectOneMenu id="statusId" styleClass="FormCampo">
								<f:selectItem itemValue="0" itemLabel="" />				
								<f:selectItem itemValue="1" itemLabel="Ativo" />
								<f:selectItem itemValue="2" itemLabel="Inativo" />
							</h:selectOneMenu>
							<h:commandButton id="comandoCadastrar" value="Procurar" >
							</h:commandButton>
		        	</span> 				
				</fieldset>	
			</h:form>
		</div>		
	</body>
	</html>
</f:view>

agora, por que me ocorre esse erro?
qual o motivo

abs
T+

Richfaces 3.2 não funciona mais com JSF1.1 nem com Java1.4, ou seja, você vai precisar atualizar tua aplicação para JSF1.2 e Java5.0 no minimo. Consequentemente se você não estiver utilizando Facelets será necessário atualizar o teu Tomcat para a versão 6.x

Abraços e boa sorte.

[quote=rponte]boa tarde,

é realmente a versão 3.2… do rich so funciona com JSF1.2 e tomcat 6, da uma olhada nas dependecias e requisicões do rich

aconselho você a usar a implementacão do MyFaces, por ser mais depurada que a jsf1.2