ICEfaces
  1. ICEfaces
  2. ICE-9359

Running under MyFaces, dragging and dropping modal dialog sometimes results in ArrayIndexOutOfBoundsException and NCI popup

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      MyFaces portal
    • Assignee Priority:
      P1

      Description

      It is intermittent and seems easiest to recreate in Safari but did see it in other browsers (Chrome, IE). Using dragging and dropping the modal dialog may work find or could generate the following service side exception and then display the NCI popup.

      {noformat}
      java.lang.ArrayIndexOutOfBoundsException: -1
      at org.icefaces.ace.component.dnd.DroppableRenderer.decode(DroppableRenderer.java:65)
      at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:469)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1379)
      at org.apache.myfaces.context.servlet.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:731)
      at org.apache.myfaces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:214)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:956)
      at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1167)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:984)
      at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1167)
      at javax.faces.component.UIForm.visitTree(UIForm.java:354)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:984)
      at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1167)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:984)
      at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1167)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:984)
      at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1167)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:984)
      at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1167)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:984)
      at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1167)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:984)
      at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1167)
      at org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialExecute(PartialViewContextImpl.java:420)
      at org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:401)
      at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:88)
      at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:88)
      at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:281)
      at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:88)
      at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:281)
      at javax.faces.component.UIViewRoot$ApplyRequestValuesPhaseProcessor.process(UIViewRoot.java:1488)
      at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1372)
      at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:759)
      at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:38)
      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      at com.liferay.faces.bridge.BridgePhaseResourceImpl.execute(BridgePhaseResourceImpl.java:100)
      at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:128)
      at javax.portlet.faces.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:178)
      {noformat}

        Activity

        Hide
        Deryk Sinotte added a comment -

        Looks like there may be some additional variables involved. I had another draggable portlet on the page (Data Table Integration Example ) and it looks like if you drag the modal on to that other portlet, the exception occurs.

        Steps I used to reproduce:

        • Before building you'll need to remove two listeners from the web.xml file that are there to fix a specific bug with Mojarra:

        <!-- Specifying these listeners in this order as per http://issues.liferay.com/browse/FACES-1511 -->
        <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
        </listener>

        <listener>
        <listener-class>com.liferay.faces.bridge.servlet.BridgeSessionListener</listener-class>
        </listener>

        • Build and deploy the showcase-portlet example using MyFaces (ant -Dmyfaces="true" clean liferay6.servlet-profile).
        • Add the modal dialog example and one of the drag and drop portlets to a portal page.
        • Open the modal dialog and then drag/drop it somewhere on the other portlet. Not sure if the location of the drop is important so you may need to try several different spots. I don't believe it matters which browser as I've seen it happen with Safari, Firefox, and Chrome.
        Show
        Deryk Sinotte added a comment - Looks like there may be some additional variables involved. I had another draggable portlet on the page (Data Table Integration Example ) and it looks like if you drag the modal on to that other portlet, the exception occurs. Steps I used to reproduce: Before building you'll need to remove two listeners from the web.xml file that are there to fix a specific bug with Mojarra: <!-- Specifying these listeners in this order as per http://issues.liferay.com/browse/FACES-1511 --> <listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener> <listener> <listener-class>com.liferay.faces.bridge.servlet.BridgeSessionListener</listener-class> </listener> Build and deploy the showcase-portlet example using MyFaces (ant -Dmyfaces="true" clean liferay6.servlet-profile). Add the modal dialog example and one of the drag and drop portlets to a portal page. Open the modal dialog and then drag/drop it somewhere on the other portlet. Not sure if the location of the drop is important so you may need to try several different spots. I don't believe it matters which browser as I've seen it happen with Safari, Firefox, and Chrome.
        Hide
        Arturo Zambrano added a comment -

        Thank you Deryk. Yes, I think it might be related to using a data table, since the exception is reported in a line of the code involving the 'datasource' attribute, which looks at the row's index to retrieve a data object from the UIData component. So, I didn't see the connection at first. I think this might be fixed by simply adding an array bounds check for the cases that aren't explicitly using the 'datasource' feature.

        Show
        Arturo Zambrano added a comment - Thank you Deryk. Yes, I think it might be related to using a data table, since the exception is reported in a line of the code involving the 'datasource' attribute, which looks at the row's index to retrieve a data object from the UIData component. So, I didn't see the connection at first. I think this might be fixed by simply adding an array bounds check for the cases that aren't explicitly using the 'datasource' feature.
        Hide
        Arturo Zambrano added a comment -

        Committed fix to trunk at revision 36291 and to the 3.3 EE tag at revision 36292.

        The problem was only caused when dropping any external draggable on the drop area of the table integration demo, which uses the 'datasource' functionality. The fix is in adding a try-catch clause the the part of the code that processes that and resorting to a default behaviour when an unexpected problem occurs. Also, the demo was modified by adding a 'scope' to the droppable and draggables, so that the droppable only accepts the draggables of the same portlet (which have the same scope).

        Show
        Arturo Zambrano added a comment - Committed fix to trunk at revision 36291 and to the 3.3 EE tag at revision 36292. The problem was only caused when dropping any external draggable on the drop area of the table integration demo, which uses the 'datasource' functionality. The fix is in adding a try-catch clause the the part of the code that processes that and resorting to a default behaviour when an unexpected problem occurs. Also, the demo was modified by adding a 'scope' to the droppable and draggables, so that the droppable only accepts the draggables of the same portlet (which have the same scope).
        Hide
        Deryk Sinotte added a comment -

        Verified. Multiple draggable and droppable components can now live harmoniously on the same portal page without causing the described exceptions.

        Show
        Deryk Sinotte added a comment - Verified. Multiple draggable and droppable components can now live harmoniously on the same portal page without causing the described exceptions.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: