ICEfaces
  1. ICEfaces
  2. ICE-7318

NPE thrown when changing tab content with menus

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1-Beta
    • Fix Version/s: 2.1-Beta2, 3.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Williams 1Line app

      Description

      A NullPointerException is thrown when a certain set of steps are taken in the WIlliams 1Line app.

      Steps to reproduce in their app:
       - Create a new Tab using the "+" icon.
       - Load Billing Adjustment List page under Samples menu.
       - Then change the tab content by loading the Comfirmation page.
       - If the tab content is changed again or if an update occurs on the Confirmation Page, the NPE is thrown.

      This seems to be only reproducible with these exact steps. If I load the Confirmation page first and then the Billing page, no error. Seems to be only when the Billing page and confirmation page is loaded in the same tab, one after the other.

      Exception Stack Trace:
      ##############Unexpected AJAX Request Processing Exception###################
      java.lang.NullPointerException
      at com.sun.faces.application.view.StateManagementStrategyImpl$4.visit(StateManagementStrategyImpl.java:331)
      at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1589)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at javax.faces.component.UIForm.visitTree(UIForm.java:344)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at javax.faces.component.UINamingContainer.visitTree(UINamingContainer.java:163)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
      at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:326)
      at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)
      at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:452)
      at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311)
      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:619)
      1. billing_adjustment_list.xhtml
        8 kB
        Arran Mccullough
      2. confirmation_pda.xhtml
        2 kB
        Arran Mccullough
      3. list_page_template.xhtml
        8 kB
        Arran Mccullough
      1. menuBar-NPE-1Line.JPG
        119 kB

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached source code of the pages. They both use the same template which includes the ace:menuBar. The confirmation page is made up of many different files which can be provided if needed.

        Show
        Arran Mccullough added a comment - Attached source code of the pages. They both use the same template which includes the ace:menuBar. The confirmation page is made up of many different files which can be provided if needed.
        Hide
        Ted Goddard added a comment -

        Mark, please detail your setTransient() workaround.

        Show
        Ted Goddard added a comment - Mark, please detail your setTransient() workaround.
        Hide
        Mark Collette added a comment -

        Assuming the issue is with the menuBar and programmatically specified menuitems, then the theory is that we need to mark the menuitems as transient, which should remove them from the view and not state save them. The menuBar would need to also re-add the menuitems on decode, so that the actionListeners would still fire, as I believe they're currently added while rendering.

        Show
        Mark Collette added a comment - Assuming the issue is with the menuBar and programmatically specified menuitems, then the theory is that we need to mark the menuitems as transient, which should remove them from the view and not state save them. The menuBar would need to also re-add the menuitems on decode, so that the actionListeners would still fire, as I believe they're currently added while rendering.
        Hide
        Ken Fyten added a comment -

        Brad says:

        This specific scenario is no longer reproducible in terms of different source menus are now used to launch the pages, but I was able to populate one tab with the two pages of tab content and could not reproduce the error.

        Show
        Ken Fyten added a comment - Brad says: This specific scenario is no longer reproducible in terms of different source menus are now used to launch the pages, but I was able to populate one tab with the two pages of tab content and could not reproduce the error.
        Hide
        Mark Collette added a comment -

        Now the dynamic menuBar (menu, contextmenu) children are loaded on decode and render, and marked transient so that they'll not participate in state saving.

        Development branch
        Subversion 25936
        ace/component/src/org/icefaces/ace/component/menu/AbstractMenu.java

        Show
        Mark Collette added a comment - Now the dynamic menuBar (menu, contextmenu) children are loaded on decode and render, and marked transient so that they'll not participate in state saving. Development branch Subversion 25936 ace/component/src/org/icefaces/ace/component/menu/AbstractMenu.java
        Hide
        Mark Collette added a comment -

        Documented some guidance for how the menuitem and submenu components should be created.

        Development branch
        Subversion 26033
        ace/component/src/org/icefaces/ace/component/contextmenu/ContextMenuMeta.java
        ace/component/src/org/icefaces/ace/component/menu/MenuMeta.java
        ace/component/src/org/icefaces/ace/component/menubar/MenubarMeta.java
        ace/component/src/org/icefaces/ace/component/menubutton/MenuButtonMeta.java

        Show
        Mark Collette added a comment - Documented some guidance for how the menuitem and submenu components should be created. Development branch Subversion 26033 ace/component/src/org/icefaces/ace/component/contextmenu/ContextMenuMeta.java ace/component/src/org/icefaces/ace/component/menu/MenuMeta.java ace/component/src/org/icefaces/ace/component/menubar/MenubarMeta.java ace/component/src/org/icefaces/ace/component/menubutton/MenuButtonMeta.java

          People

          • Assignee:
            Mark Collette
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: