Open glassfishrobot opened 17 years ago
@glassfishrobot Commented Reported by kenpaulsen
@glassfishrobot Commented rogerk said: r=rogerk
@glassfishrobot Commented Was assigned to jsf-extensions-issues
@glassfishrobot Commented This issue was imported from java.net JIRA JSF_EXTENSIONS-75
A GlassFish user reported the exception below. It appears the response has been completed and the FacesContext is no longer available. However, a finally block after the request is trying to clean stuff up and throwing a NPE when attempting to use a null FacesContext. See below the following exception for my proposed solution (null check). If you'd like me to commit this change, assign the bug to me and I'll check it in.
Thanks,
Ken
jsf.lifecycle.phase.exception SEVERE [javax.enterprise.resource.webcontainer.jsf.lifecycle]
.
StandardWrapperValve[FacesServlet]: PWC1406: Servlet.service() for servlet FacesServlet threw
exception
java.lang.NullPointerException
at com.sun.faces.extensions.avatar.lifecycle.AsyncResponse.getPartialTraversalViewRoot(AsyncResponse.java:831)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:83)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at com.sun.enterprise.tools.admingui.servlet.DelayedInitFacesServlet.service(DelayedInitFacesServlet.java:66)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:240)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:258)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:189)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:611)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:564)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:81)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:193)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:611)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:558)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1067)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:611)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:558)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1067)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:255)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:618)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:549)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:790)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:248)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:199)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)
SEVERE [javax.enterprise.system.container.web]
Here's the proposed solution:
/**
@return Value of property partialTraversalViewRoot. */ public PartialTraversalViewRoot getPartialTraversalViewRoot() { PartialTraversalViewRoot result = this.partialTraversalViewRoot; if (null == result) { FacesContext ctx = FacesContext.getCurrentInstance(); if (ctx != null)Unknown macro: { UIViewRoot root = ctx.getViewRoot(); if (root instanceof PartialTraversalViewRoot) { result = (PartialTraversalViewRoot) root; } }
} return result; }
Environment
Operating System: All Platform: All
Affected Versions
[current]