Re: Exception occured “java.lang.IllegalStateException: Context is already active”

Splash Forums PrettyFaces Users Exception occured "java.lang.IllegalStateException: Context is already active" Re: Exception occured “java.lang.IllegalStateException: Context is already active”

#21304

meirka
Participant

Hi, it’s empty project.

I am using version 3.3.0

And the problem occur even when RequestScope.

As you say – maybe one Exception is behind this, as you can see in the log:

INFO: Exception when handling error trying to reset the response.

java.lang.NullPointerException

at com.sun.faces.context.flash.ELFlash.doLastPhaseActions(ELFlash.java:607)

at com.sun.faces.context.ExternalContextImpl.responseFlushBuffer(ExternalContextImpl.java:857)

at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:155)

at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)

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.StandardWrapper.service(StandardWrapper.java:1539)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)

at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)

at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)

at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)

at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)

at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)

at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

at java.lang.Thread.run(Thread.java:662)

WARNING: JSF1087: Unable to generate Facelets error page as the response has already been committed.

SEVERE: javax.faces.FacesException

javax.faces.FacesException

at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:141)

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.StandardWrapper.service(StandardWrapper.java:1539)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)

at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)

at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)

at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)

at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)

at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)

at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

at java.lang.Thread.run(Thread.java:662)

Caused by: java.lang.NullPointerException

at com.sun.faces.context.flash.ELFlash.doLastPhaseActions(ELFlash.java:607)

at com.sun.faces.context.ExternalContextImpl.responseFlushBuffer(ExternalContextImpl.java:857)

at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:155)

at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)

at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

… 35 more