Problemas com JSF[RESOLVIDO]

Olá, estou tendo o seguinte problema com o JSF:

Stacktrace:] with root cause java.lang.RuntimeException: Cannot find FacesContext at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1852) at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1669) at org.apache.jsp.index_jsp._jspService(index_jsp.java:198) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Segue meu web.xml:

[code]<?xml version="1.0" encoding="UTF-8"?>

sapc-www

<context-param>
   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
   <param-value>server</param-value>
</context-param>

<context-param>
   <param-name>org.richfaces.SKIN</param-name>
   <param-value>blueSky</param-value>
</context-param>

<context-param>
	<param-name>org.richfaces.CONTROL_SKINNING</param-name>
	<param-value>disable</param-value>
</context-param>
 
 <filter>
	<display-name>RichFaces Filter</display-name>
	<filter-name>richfaces</filter-name>
	<filter-class>org.ajax4jsf.Filter</filter-class> 
</filter> 

<filter-mapping> 
   <filter-name>richfaces</filter-name> 
   <servlet-name>Faces Servlet</servlet-name>
   <dispatcher>REQUEST</dispatcher>
   <dispatcher>FORWARD</dispatcher>
   <dispatcher>INCLUDE</dispatcher>
</filter-mapping>

 <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> 
	<url-pattern>*.faces</url-pattern> 
	</servlet-mapping> 
	 
 <servlet-mapping>
   <servlet-name>Faces Servlet</servlet-name>
   <url-pattern>*.jsf</url-pattern>
</servlet-mapping>

 <!-- Session time out Configuration -->
<session-config>
	<!-- Min -->
	<session-timeout>50</session-timeout>
</session-config>

<!-- The Welcome File List -->
<welcome-file-list>
	<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>

 <!-- mapaemento do struts 2 -->
<filter>
	<filter-name>struts2</filter-name>
	<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
	<filter-name>struts2</filter-name>
	<url-pattern>/*</url-pattern>
	<dispatcher>REQUEST</dispatcher>
	<dispatcher>FORWARD</dispatcher>
	<dispatcher>INCLUDE</dispatcher>
	<dispatcher>ERROR</dispatcher>
</filter-mapping>  


<!--  
<filter>
	<filter-name>ControleAcessoFilter</filter-name>
	<filter-class>br.gov.ibge.sapc.web.controleacesso.action.ControleAcessoFilter</filter-class>
</filter>
<filter-mapping>
	<filter-name>ControleAcessoFilter</filter-name>
	<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
	<filter-name>ControleAcessoFilter</filter-name>
	<url-pattern>*.do</url-pattern>
</filter-mapping> 
-->
index.html index.htm index.jsp default.html default.htm default.jsp [/code]

segue meu faces-config:

[code]<?xml version="1.0" encoding="UTF-8"?>

<!-- 

<managed-bean>
	<managed-bean-name>loginBean</managed-bean-name>
	<managed-bean-class>bean.LoginBean</managed-bean-class>
	<managed-bean-scope>request</managed-bean-scope>
</managed-bean>

 -->
 
<navigation-rule>
	<from-view-id>/index.jsp</from-view-id>
	<navigation-case>
  		<from-outcome>accepted</from-outcome>
  		<to-view-id>/jsp/index_mod.jsp</to-view-id>
	</navigation-case>
	<navigation-case>
    	<from-outcome>rejected</from-outcome>
    	<to-view-id>/index.jsp</to-view-id>
	</navigation-case>
</navigation-rule>

[/code]

Obs: estou utilizando o JSF 2.0

oi,

já passei por isso algumas vezes, veja se isso ajuda

  1. coloque as linhas abaixo no seu web.xml

&lt;listener&gt; &lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt; &lt;/listener&gt;

  1. veja se o seu servidor de aplicação já possui as libs jsf-api e jsf-impl, se tiver remova do seu projeto

  2. reinicie o servidor e refaça o deploy

abs

Sim, as libs estão em WEB-INF/lib.

veja se o servidor que está fazendo o deploy também possui essas libs, se tiver remova do seu projeto e tente fazer o deploy novamente.

O servidor não possui estas bibliotecas, estas, foram adcionadas ao projeto.
Estou chamando o método de meu bean da seguinte forma: #{login.imprime} que etá gerando a seguinte exceção:

javax.servlet.ServletException: /index.jsp(156,12) '#{loginBean.login}' Target Unreachable, identifier 'loginBean' resolved to null

o que pode estar errado?

Segue o código do meu bean:

[code]package bean;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean(name=“loginBean”)
@RequestScoped
public class LoginBean {

private String login;
private String senha;


public void imprime()
{
	System.out.println("Olá " + login);
}

public LoginBean(){}

public String getLogin() {
	return login;
}

public void setLogin(String login) {
	this.login = login;
}

public String getSenha() {
	return senha;
}

public void setSenha(String senha) {
	this.senha = senha;
}

}[/code]

oi,

acho é problema na configuração do faces-config.xml

dá uma olhada no tópico abaixo

abs

conseguiu resolver? era isso mesmo?

Sim, muito obrigado pela ajuda! :wink: