ICEfaces
  1. ICEfaces
  2. ICE-9666

Check for duplicate bridge setup forms

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: EE-3.3.0.GA_P02
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      n/a

      Description

      In certain situations, the BridgeFormsSetup JSF event listener may become registered more than once, leading to the following error:

      javax.servlet.ServletException: Cannot add the same component twice: v1y8jav2-retrieve-update
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
      root cause

      javax.faces.FacesException: Cannot add the same component twice: v1y8jav2-retrieve-update
      com.sun.faces.context.StateContext$AddRemoveListener.handleAddRemoveWithAutoPrune(StateContext.java:510)
      com.sun.faces.context.StateContext$AddRemoveListener.handleAdd(StateContext.java:437)
      com.sun.faces.context.StateContext$AddRemoveListener.processEvent(StateContext.java:359)
      javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
      com.sun.faces.application.ApplicationImpl.processListenersAccountingForAdds(ApplicationImpl.java:2212)
      com.sun.faces.application.ApplicationImpl.invokeViewListenersFor(ApplicationImpl.java:2033)
      com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:292)
      com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247)
      javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2203)
      javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1885)
      javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:405)
      javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2637)
      javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2609)
      org.icefaces.impl.event.BridgeFormsSetup.addNewTransientForm(BridgeFormsSetup.java:53)
      org.icefaces.impl.event.BridgeFormsSetup.processEvent(BridgeFormsSetup.java:36)
      javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
      com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2163)
      com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2139)
      com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:303)
      com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247)
      javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:814)
      javax.faces.component.UIComponent.encodeAll(UIComponent.java:1817)
      javax.faces.component.UIComponent.encodeAll(UIComponent.java:1822)
      com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:447)
      com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
      javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
      com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)

      This can be avoided by checking for a duplicate id before creating the form.

      http://www.icesoft.org/JForum/po1sts/list/22121.page http://www.icesoft.org/JForum/posts/list/21975.page http://stackoverflow.com/questions/18873085/jsf-cannot-add-the-same-component-twice-error-while-running-icefaces-3-0-comp

        Activity

        Hide
        Philip Breau added a comment -

        Revision: 38674
        Author: philip.breau
        Date: October-26-13 9:27:52 AM
        Message:
        ICE-9666 Check for duplicate bridge setup forms


        Modified : /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/BridgeFormsSetup.java

        Show
        Philip Breau added a comment - Revision: 38674 Author: philip.breau Date: October-26-13 9:27:52 AM Message: ICE-9666 Check for duplicate bridge setup forms Modified : /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/BridgeFormsSetup.java
        Hide
        Mircea Toma added a comment -

        Back-ported fix.

        Show
        Mircea Toma added a comment - Back-ported fix.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Philip Breau
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: