Olá Pessoal.
Estou a uma semana tentando encontrar a solução para este erro e não encontrei em lugar algum.
Estou desenvolvendo um sistema utilizando JSF 2 + PrimeFaces 3 + TomCat 6 e 7. Pois bem, ao compilar o programa no eclipse ele me gera um erro, segue abaixo, ao compilar o netbeans ele funciona perfeitamente. Baixei a última versão do TomCat 7.0.28, criei e .WAR e também apresentou o mesmo erro.
Segue abaixo.
Complementando, quando compilo ele no netbeans, crio o .WAR e jogo para o tomcat que roda em meu servidor, ele gera o mesmo erro. No NetBeans ele funciona somente local.
Jun 29, 2012 9:50:48 AM org.apache.catalina.core.AprLifecycleListener init
Informações: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Program Files\Borland\Delphi7\Bin;C:\Program Files\Borland\Delphi7\Projects\Bpl;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\eclipse;;.
Jun 29, 2012 9:50:48 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
Advertência: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:SisTI’ did not find a matching property.
Jun 29, 2012 9:50:49 AM org.apache.coyote.http11.Http11Protocol init
Informações: Initializing Coyote HTTP/1.1 on http-8080
Jun 29, 2012 9:50:49 AM org.apache.catalina.startup.Catalina load
Informações: Initialization processed in 1209 ms
Jun 29, 2012 9:50:49 AM org.apache.catalina.core.StandardService start
Informações: Starting service Catalina
Jun 29, 2012 9:50:49 AM org.apache.catalina.core.StandardEngine start
Informações: Starting Servlet Engine: Apache Tomcat/6.0.35
Jun 29, 2012 9:50:51 AM org.apache.catalina.core.StandardContext addApplicationListener
Informações: The listener “com.sun.faces.config.ConfigureListener” is already configured for this context. The duplicate definition has been ignored.
Jun 29, 2012 9:50:51 AM com.sun.faces.config.ConfigureListener contextInitialized
Informações: Inicializando Mojarra 2.1.7 (SNAPSHOT 20120206) para o contexto '/SisTI’
Jun 29, 2012 9:50:54 AM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
Informações: Running on PrimeFaces 3.2
Jun 29, 2012 9:50:54 AM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
Informações: Running on PrimeFaces 3.2
Jun 29, 2012 9:50:54 AM org.apache.coyote.http11.Http11Protocol start
Informações: Starting Coyote HTTP/1.1 on http-8080
Jun 29, 2012 9:50:54 AM org.apache.jk.common.ChannelSocket init
Informações: JK: ajp13 listening on /0.0.0.0:8009
Jun 29, 2012 9:50:54 AM org.apache.jk.server.JkMain start
Informações: Jk running ID=0 time=0/47 config=null
Jun 29, 2012 9:50:54 AM org.apache.catalina.startup.Catalina start
Informações: Server startup in 5050 ms
Jun 29, 2012 9:50:57 AM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
Grave: Error Rendering View[/index.xhtml]
java.lang.IllegalStateException: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2437)
at org.apache.catalina.connector.Request.getSession(Request.java:2157)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:155)
at com.sun.faces.renderkit.ServerSideStateHelper.writeState(ServerSideStateHelper.java:175)
at com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:122)
at com.sun.faces.application.StateManagerImpl.writeState(StateManagerImpl.java:166)
at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:419)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
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:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Jun 29, 2012 9:50:57 AM com.sun.faces.context.ExceptionHandlerImpl throwIt
Informações: Exception when handling error trying to reset the response.
java.lang.IllegalStateException: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2437)
at org.apache.catalina.connector.Request.getSession(Request.java:2157)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:155)
at com.sun.faces.renderkit.ServerSideStateHelper.writeState(ServerSideStateHelper.java:175)
at com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:122)
at com.sun.faces.application.StateManagerImpl.writeState(StateManagerImpl.java:166)
at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:419)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
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:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Jun 29, 2012 9:50:57 AM com.sun.faces.renderkit.RenderKitUtils renderHtmlErrorPage
Advertência: JSF1087: Não foi possível gerar a página de erro de Facelets porque a resposta já foi enviada.
Jun 29, 2012 9:50:57 AM com.sun.faces.renderkit.RenderKitUtils renderHtmlErrorPage
Grave: javax.faces.FacesException: Cannot create a session after the response has been committed
javax.faces.FacesException: Cannot create a session after the response has been committed
at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:142)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
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:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2437)
at org.apache.catalina.connector.Request.getSession(Request.java:2157)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:155)
at com.sun.faces.renderkit.ServerSideStateHelper.writeState(ServerSideStateHelper.java:175)
at com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:122)
at com.sun.faces.application.StateManagerImpl.writeState(StateManagerImpl.java:166)
at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:419)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
… 14 more
ja tive esse problema, coloque isso no web.xml
<context-param>
<param-name>com.sun.faces.writeStateAtFormEnd</param-name>
<param-value>false</param-value>
</context-param>
Resolvido. Era isso mesmo Mauricio, valeu pela força.
Forte abraço.