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

        Deryk Sinotte created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Assignee Arturo Zambrano [ artzambrano ]
        Assignee Priority P1 [ 10010 ]
        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.
        Ken Fyten made changes -
        Fix Version/s 3.4 [ 10770 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #36289 Tue Jun 18 18:42:25 MDT 2013 art.zambrano ICE-9359 added try-catch clause to code that might cause index-out-of-bounds and parsing exceptions, and set a default value if an exception occurs
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dnd/DroppableRenderer.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #36291 Tue Jun 18 19:02:49 MDT 2013 art.zambrano ICE-9359 added a 'scope' to the droppable and draggables to avoid allowing dropping draggables that do not belong in there when using portlets, and causing exceptions and unexpected behaviour
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/ace/dragDrop/dataTableIntegration.xhtml
        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).
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Arturo Zambrano made changes -
        Component/s ACE-Components [ 10050 ]
        Component/s Components [ 10012 ]
        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.
        Deryk Sinotte made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: