0 Replies Latest reply on May 19, 2009 8:16 AM by Kamil Hadiyev

    NullPointerException when trying to refresh application with destroyed session. Why so?

    Kamil Hadiyev Newbie

      I have exception, if I try to refresh page when session is destroyed:



      [#|2009-04-02T20:06:12.729+0200|WARNING|sun-appserver2.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8088-0;_RequestID=564f45db-9a1a-42d3-829e-1b6b3cc31f34;|executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@f25715) threw exception 
      javax.faces.application.ViewExpiredException: viewId:/rbtemplates.xhtml - View /rbtemplates.xhtml could not be restored. 
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:187) 
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) 
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117) 
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244) 
      at cz.atria.common.web.servlet.ExceptionHandlerFacesServlet.service(ExceptionHandlerFacesServlet.java:40) 
      at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427) 
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333) 
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) 
      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) 
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) 
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) 
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) 
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178) 
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) 
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390) 
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517) 
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) 
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58) 
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) 
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) 
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313) 
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287) 
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) 
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) 
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98) 
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) 
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) 
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096) 
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) 
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) 
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096) 
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288) 
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647) 
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579) 
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831) 
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) 
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) 
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) 
      at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380) 
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) 
      at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) 
      |#] 
      
      [#|2009-04-02T20:06:16.760+0200|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8088-0;_RequestID=564f45db-9a1a-42d3-829e-1b6b3cc31f34;|StandardWrapperValve[Utilis Faces Servlet]: PWC1406: Servlet.service() for servlet Utilis Faces Servlet threw exception 
      java.lang.NullPointerException 
      at org.apache.coyote.tomcat5.CoyoteRequest.removeAttribute(CoyoteRequest.java:1742) 
      at org.apache.coyote.tomcat5.CoyoteRequestFacade.removeAttribute(CoyoteRequestFacade.java:592) 
      at javax.servlet.ServletRequestWrapper.removeAttribute(ServletRequestWrapper.java:335) 
      at com.sun.faces.context.RequestMap.remove(ExternalContextImpl.java:1080) 
      at org.jboss.seam.contexts.BasicContext.remove(BasicContext.java:74) 
      at org.jboss.seam.Component.newInstance(Component.java:2103) 
      at org.jboss.seam.Component.getInstance(Component.java:1988) 
      at org.jboss.seam.Component.getInstance(Component.java:1967) 
      at org.jboss.seam.Component.getInstance(Component.java:1961) 
      at org.jboss.seam.Component.getInstance(Component.java:1934) 
      at org.jboss.seam.Component.getInstance(Component.java:1929) 
      at org.jboss.seam.core.Events.instance(Events.java:157) 
      at org.jboss.seam.core.Events.exists(Events.java:152) 
      at org.jboss.seam.security.Credentials.getUsername(Credentials.java:43) 
      at org.jboss.seam.security.Identity.getUsername(Identity.java:653) 
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:50) 
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) 
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) 
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313) 
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287) 
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) 
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) 
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98) 
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) 
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) 
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096) 
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) 
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) 
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096) 
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288) 
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647) 
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579) 
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831) 
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) 
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) 
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) 
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) 
      at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) 
      |#] 
      
      [#|2009-04-02T20:07:06.559+0200|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8088-0;_RequestID=564f45db-9a1a-42d3-829e-1b6b3cc31f34;|StandardWrapperValve[Utilis Faces Servlet]: PWC1406: Servlet.service() for servlet Utilis Faces Servlet threw exception 
      java.lang.NullPointerException 
      at org.apache.coyote.tomcat5.CoyoteRequest.removeAttribute(CoyoteRequest.java:1742) 
      at org.apache.coyote.tomcat5.CoyoteRequestFacade.removeAttribute(CoyoteRequestFacade.java:592) 
      at javax.servlet.ServletRequestWrapper.removeAttribute(ServletRequestWrapper.java:335) 
      at com.sun.faces.context.RequestMap.remove(ExternalContextImpl.java:1080) 
      at org.jboss.seam.contexts.BasicContext.remove(BasicContext.java:74) 
      at org.jboss.seam.Component.newInstance(Component.java:2103) 
      at org.jboss.seam.Component.getInstance(Component.java:1988) 
      at org.jboss.seam.Component.getInstance(Component.java:1967) 
      at org.jboss.seam.Component.getInstance(Component.java:1961) 
      at org.jboss.seam.Component.getInstance(Component.java:1934) 
      at org.jboss.seam.Component.getInstance(Component.java:1929) 
      at org.jboss.seam.core.Events.instance(Events.java:157) 
      at org.jboss.seam.core.Events.exists(Events.java:152) 
      at org.jboss.seam.security.Credentials.getUsername(Credentials.java:43) 
      at org.jboss.seam.security.Identity.getUsername(Identity.java:653) 
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:50) 
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) 
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) 
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313) 
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287) 
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) 
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) 
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98) 
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) 
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) 
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096) 
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) 
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) 
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) 
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096) 
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288) 
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647) 
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579) 
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831) 
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) 
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) 
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) 
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) 
      at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) 
      |#] 
      



      The code where exception casused was found:



      Object value = null; 
      boolean found = attributes.containsKey(name); 
      if (found) { 
      value = attributes.get(name); 
      attributes.remove(name); // NPE is here 
      } else { 
      return; 
      }