ICEfaces
  1. ICEfaces
  2. ICE-10641

Cannot add the same component twice: javax_faces_location_HEAD

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-4.0.0.GA
    • Fix Version/s: 4.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Mojarra 2.2.10, ICEfaces EE 4
    • Assignee Priority:
      P1
    • Support Case References:
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Turn off Partial State saving:

          <context-param>
              <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
              <param-value>false</param-value>
          </context-param>

      Or use Mojarra 2.2.7 or Myfaces 2.2.7
      Show
      Turn off Partial State saving:     <context-param>         <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>         <param-value>false</param-value>     </context-param> Or use Mojarra 2.2.7 or Myfaces 2.2.7

      Description

      When using dynamin ui:includes for navigation/displaying content. After loading some content, navigating, then loading the previous page/content, the following error is thrown and the Network Connection Interrupted dialog is shown:


      15-Apr-2015 13:08:44.782 SEVERE [http-nio-8084-exec-12] com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError javax.faces.FacesException: Cannot add the same component twice: javax_faces_location_HEAD
      at com.sun.faces.context.StateContext$DynamicAddRemoveListener.handleAddRemoveWithAutoPrune(StateContext.java:748)
      at com.sun.faces.context.StateContext$DynamicAddRemoveListener.handleAdd(StateContext.java:664)
      at com.sun.faces.context.StateContext$AddRemoveListener.processEvent(StateContext.java:347)
      at com.sun.faces.context.StateContext$DynamicAddRemoveListener.processEvent(StateContext.java:565)
      at javax.faces.event.SystemEvent.processListener(SystemEvent.java:108)
      at javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:118)
      at com.sun.faces.application.ApplicationImpl.processListenersAccountingForAdds(ApplicationImpl.java:2218)
      at com.sun.faces.application.ApplicationImpl.invokeViewListenersFor(ApplicationImpl.java:2036)
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:290)
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:245)
      at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2253)
      at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1934)
      at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:447)
      at javax.faces.component.UIComponentBase$FacetsMap.put(UIComponentBase.java:2993)
      at javax.faces.component.UIComponentBase$FacetsMap.put(UIComponentBase.java:2953)
      at javax.faces.component.UIViewRoot.getComponentResources(UIViewRoot.java:1818)
      at javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:521)
      at org.icefaces.impl.application.InitializeHeadAndBodyFacetContainers.initializeFacetContainer(InitializeHeadAndBodyFacetContainers.java:49)
      at org.icefaces.impl.application.InitializeHeadAndBodyFacetContainers.beforePhase(InitializeHeadAndBodyFacetContainers.java:34)
      at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:655)
      at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:745)

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case that show this issue.

        Steps:

        • Load welcomeICEfaces.jsf
        • Initially a Login page is shown, click the Login to login.
        • The Default page is now shown with an h:selectOneListbox on the page.
        • From the Menu, select Two, the page Two content is shown.
        • Select Three, the page Three content is shown.
        • Select Two again, the error and dialog is now shown.
        Show
        Arran Mccullough added a comment - Attached test case that show this issue. Steps: Load welcomeICEfaces.jsf Initially a Login page is shown, click the Login to login. The Default page is now shown with an h:selectOneListbox on the page. From the Menu, select Two, the page Two content is shown. Select Three, the page Three content is shown. Select Two again, the error and dialog is now shown.
        Hide
        Ken Fyten added a comment -

        Need to analyze this to see if it's something we can correct or possibly a Mojarra issue.

        Show
        Ken Fyten added a comment - Need to analyze this to see if it's something we can correct or possibly a Mojarra issue.
        Hide
        Mircea Toma added a comment - - edited

        Set a temporary no-op view root while initialising the head and body containers to avoid having the add/remove component listeners on the original view root invoked.

        Show
        Mircea Toma added a comment - - edited Set a temporary no-op view root while initialising the head and body containers to avoid having the add/remove component listeners on the original view root invoked.
        Hide
        Mircea Toma added a comment -

        Propagate view map values to the temporary view root and back.

        Show
        Mircea Toma added a comment - Propagate view map values to the temporary view root and back.
        Hide
        Mircea Toma added a comment -

        Remove temporarily PostAddToView and PreRemoveFromView event listeners from the view to avoid having JSF replay the dynamic addition and removal of components (the JSF feature is implemented as system listener).

        This strategy avoids clearing the view map (when resetting the view root) which triggers unwanted events.

        Show
        Mircea Toma added a comment - Remove temporarily PostAddToView and PreRemoveFromView event listeners from the view to avoid having JSF replay the dynamic addition and removal of components (the JSF feature is implemented as system listener). This strategy avoids clearing the view map (when resetting the view root) which triggers unwanted events.
        Hide
        Ken Fyten added a comment -

        Re-opened due to regressions caused by this commit as described in ICE-10756.

        Show
        Ken Fyten added a comment - Re-opened due to regressions caused by this commit as described in ICE-10756.
        Hide
        Mircea Toma added a comment -

        This is no longer an issue since ICE-10756 was fixed.

        Show
        Mircea Toma added a comment - This is no longer an issue since ICE-10756 was fixed.
        Hide
        Alfonso Miranda added a comment -

        Hi Arran Mccullough, finally how was resolved this issue?
        I am facing a similary problem whith menu component.
        Can you comment me?

        Show
        Alfonso Miranda added a comment - Hi Arran Mccullough, finally how was resolved this issue? I am facing a similary problem whith menu component. Can you comment me?
        Hide
        Arran Mccullough added a comment -

        Hi Alfonso,

        This issue is resolved for the next ICEfaces 4.1.0 release. It isn't available yet so you might want to try the documented workarounds to see if this helps you until the 4.1.0 release is available.

        Show
        Arran Mccullough added a comment - Hi Alfonso, This issue is resolved for the next ICEfaces 4.1.0 release. It isn't available yet so you might want to try the documented workarounds to see if this helps you until the 4.1.0 release is available.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: