Pois é, está sendo retornado esse erro: facesContext not found. O que que provoca isso?
Está aqui o tracer do meu erro:
org.apache.jasper.JasperException: An exception occurred processing JSP page /indexD.jsp at line 15
12:
13: session.setAttribute("usuario", usuario);
14: %>
15: <jsp:forward page="/acesso/acesso.jsp"/>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
org.apache.jasper.JasperException: An exception occurred processing JSP page /acesso/acesso.jsp at line 24
21: <p>
22: <%@ include file="/sigovEstilo/titulo.jsp"%>
23: </p>
24: <f:view>
25: <h:form>
26: <f:subview id="painelBranco">
27: <jsp:include page="painelBranco.jsp"/>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667)
org.apache.jsp.indexD_jsp._jspService(indexD_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.RuntimeException: FacesContext not found
javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:238)
javax.faces.webapp.UIComponentClassicTagBase.getPreviousJspIdsSet(UIComponentClassicTagBase.java:1219)
javax.faces.webapp.UIComponentClassicTagBase.checkIfItIsInAnIterator(UIComponentClassicTagBase.java:1204)
javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:165)
org.apache.jsp.acesso.acesso_jsp._jspx_meth_f_005fview_005f0(acesso_jsp.java:183)
org.apache.jsp.acesso.acesso_jsp._jspService(acesso_jsp.java:136)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667)
org.apache.jsp.indexD_jsp._jspService(indexD_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Desde já obrigado
Por acaso você chamou essa pagina como ??? você tem que chamar assim:
suaPagina.jsf ( extensão jsf)
se você chamou por JSP deve dar erro, dependendo de como esteja seu web.xml, deve funcionar com extensão JSF.
eu chamei com jsp mesmo. Sempre usei jsp por achar mais fácil.
olha o 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>ControleAcesso</display-name>
<welcome-file-list>
<welcome-file>faces/index.jsp</welcome-file>
<welcome-file>faces/indexD.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<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>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<!-- - - - - - - - - Meus servlets para geração de relatorios - - - - - - - - - - - - - -->
<!-- - - - - Gráfico de barra - - - -->
<!-- Ano -->
<servlet>
<servlet-name>SBarraCpDepe</servlet-name>
<servlet-class>br.com.bb.sigov.controleAcesso.servlet.SBarraCpDepe</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SBarraCpDepe</servlet-name>
<url-pattern>/SBarraCpDepe</url-pattern>
</servlet-mapping>
<!-- - - - - Gráfico de Série Histórica - - - -->
<servlet>
<servlet-name>SHistoricoAplic</servlet-name>
<servlet-class>br.com.bb.sigov.controleAcesso.servlet.SHistoricoAplic</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SHistoricoAplic</servlet-name>
<url-pattern>/SHistoricoAplic</url-pattern>
</servlet-mapping>
<!-- - - - Gráfico de pizza - - - -->
<servlet>
<servlet-name>SPizzaQuantitativo</servlet-name>
<servlet-class>br.com.bb.sigov.controleAcesso.servlet.SPizzaQuantitativo</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SPizzaQuantitativo</servlet-name>
<url-pattern>/SPizzaQuantitativo</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>SPizzaCmss</servlet-name>
<servlet-class>br.com.bb.sigov.controleAcesso.servlet.SPizzaCmss</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SPizzaCmss</servlet-name>
<url-pattern>/SPizzaCmss</url-pattern>
</servlet-mapping>
</web-app>
Mas assim, agora no eclipse, o erro que está aparecendo é :
java.lang.NullPointerException: context
at javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:845)
at javax.faces.component.UIComponentBase.getRendersChildren(UIComponentBase.java:333)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:237)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.actuallyRenderView(JspViewHandlerImpl.java:424)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:380)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:45)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
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)
26/08/2008 10:35:25 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException: context
at javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:845)
at javax.faces.component.UIComponentBase.getRendersChildren(UIComponentBase.java:333)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:237)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.actuallyRenderView(JspViewHandlerImpl.java:424)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:380)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:45)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
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)
O problema é que esse erro não está sendo gerado pelo meu manage bean. Assim, todos os métodos são executados perfeitamente, porém, quando o controle volta para o JSF renderizar a tela, esse erro é lançado. Entõa, eu não sei como tratá-lo.
Outra coisa estranha, apesar desse erro, depois de um tempo a tela é renderizada pelo JSF. Ok, ok, ok, preguiçosos podem até falar “ah, mas esse está renderizando, qual o problema?” O problema é a instabilidade que o programa fica. É um software muito demandado, então ele não pode ficar dando errinhos de depois começar a lançar erro de compilação de página.
Então, alguém sabe como posso resolver isso?
A não gente, ninguém nunca teve esse problema não?
Ah sim, com o eclise, eu uso a implementação MyFaces do JSF.