ICEfaces
  1. ICEfaces
  2. ICE-8813

NullPointerException thrown for EnvUtils.containsDisposedBeans()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: EE-3.2.0.BETA, EE-3.2.0.GA, 3.3
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P1
    • Salesforce Case Reference:
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Add a @WindowDisposed annotation to the ViewScoped beans.

      Surround the set tag with a c:if tag:

                      <c:if test="#{not empty param['testParam']}">
                          <c:set var="testParam" scope="view" value="#{param['testParam']}"/>
                      </c:if>
      Show
      Add a @WindowDisposed annotation to the ViewScoped beans. Surround the set tag with a c:if tag:                 <c:if test="#{not empty param['testParam']}">                     <c:set var="testParam" scope="view" value="#{param['testParam']}"/>                 </c:if>

      Description

      A NPE is thrown when a c:set tag attempts to set/get a URL parameter that is not there. Sample code:

      <c:set var="testParam" scope="view" value="#{param['testParam']}"/>

      Stack trace:

      java.lang.NullPointerException
      at org.icefaces.util.EnvUtils.containsDisposedBeans(EnvUtils.java:702)
      at org.icefaces.impl.event.BridgeSetup$1.encode(BridgeSetup.java:148)
      at org.icefaces.impl.event.UIOutputWriter.encodeBegin(UIOutputWriter.java:27)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1755)
      at com.sun.faces.renderkit.html_basic.BodyRenderer.encodeEnd(BodyRenderer.java:101)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1764)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
      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:304)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case that shows issue.

        Steps:

        • Load /Case11820Example2/welcomeICEfaces.jsf
        • Error is thrown.
        • Load /Case11820Example2/welcomeICEfaces.jsf?testParam=222
        • No error is displayed.
        Show
        Arran Mccullough added a comment - Attached test case that shows issue. Steps: Load /Case11820Example2/welcomeICEfaces.jsf Error is thrown. Load /Case11820Example2/welcomeICEfaces.jsf?testParam=222 No error is displayed.
        Hide
        Mircea Toma added a comment -

        Modified EnvUtils.containsDisposedBeans method to test first for null attribute value before testing for WindowDisposed annotation while searching for WindowDisposed annotated beans in view scope map.

        Show
        Mircea Toma added a comment - Modified EnvUtils.containsDisposedBeans method to test first for null attribute value before testing for WindowDisposed annotation while searching for WindowDisposed annotated beans in view scope map.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: