5 Replies Latest reply on Nov 8, 2007 3:44 AM by Ilya Shaikovsky

    duplicate Id for a component error while using RichFaces 3.1

    Jim Bennett Newbie

      I just upgraded from RichFaces 3.1.1 GA to 3.1.2 GA. Now I'm getting "duplicate Id for a component" errors on components that are assigned IDs (e.g. "detailInclude:evacueeForm:j_id99"). They are occurring in a page that is included into my main page using a4j:include. The included page has several elements that are rendered/not rendered based on backing bean properties, and also a tab panel with a switchType of "client". When I assign the erroneous tag a specific id, the problem goes away for that tag, but a different duplicate then emerges elswhere. I'm fairly new to this stuff, but it looks like during the render response phase, nodes are being added to the component tree with IDs that already exist.
      Is anybody else seeing anything like this?

        • 2. Re: duplicate Id for a component error while using RichFaces
          madman1 Newbie

          Yes I had this problem on the past.

          What JSF implementation are you using?

          I think that could be a problem of JSF RI, maybe your JSF RI isn't the last release.
          Download the last release, and remeber that JSF is part of the J2EE 5, and you should change the "*.jar", that you download in your classpath and in the
          Aplication Server lib folder. The true is that I try to do it, but I can't make de App Server work fine, maybe need change also anothers lib.

          The solution for me was, download Glassfish V2 and use it. This realease of Glassfish have a new release of JSF RI, and this solution the "duplicate Id for a component" error.

          Good luck. And sorry for my english.

          • 3. Re: duplicate Id for a component error while using RichFaces
            Jim Bennett Newbie

            I just checked my versions and updated from:
            JSF 1.2_04-b16-p02
            Facelets 1.1.11
            RichFaces 3.1.2.GA

            to:
            JSF 1.2_05-b06-FCS
            Facelets 1.1.13
            RichFaces 3.1.2.GA

            I still get the same problem, though not always in the same places.
            I'm sure that I'm doing something wrong, but even so, I can't imagine that automatically assigned duplicate IDs are the intentional behavior of the framework. And I can't figure out where the problem is.
            Since this is a stack of three UI frameworks (JSF, Facelets, RichFaces) it's hard to tell what's going on.

            • 4. Re: duplicate Id for a component error while using RichFaces
              Kito Mann Apprentice

              Any word on this? I'm getting the same error with RichFaces 3.1.2GA, JSF RI 1.2_05, Facelets 1.1.3 and Tomahawk 1.1.6. The exception clearly occurs in the Ajax4JSF realm:

              java.lang.IllegalStateException: duplicate Id for a component partySearchForm:countryBlankItem
               at org.ajax4jsf.application.AjaxStateManager$TreeStrutureNode.apply(AjaxStateManager.java:442)
               at org.ajax4jsf.application.AjaxStateManager$TreeStrutureNode.apply(AjaxStateManager.java:464)
               at org.ajax4jsf.application.AjaxStateManager$TreeStrutureNode.apply(AjaxStateManager.java:464)
               at org.ajax4jsf.application.AjaxStateManager$TreeStrutureNode.apply(AjaxStateManager.java:464)
               at org.ajax4jsf.application.AjaxStateManager$TreeStrutureNode.apply(AjaxStateManager.java:464)
               at org.ajax4jsf.application.AjaxStateManager$TreeStrutureNode.apply(AjaxStateManager.java:464)
               at org.ajax4jsf.application.AjaxStateManager$TreeStrutureNode.apply(AjaxStateManager.java:464)
               at org.ajax4jsf.application.AjaxStateManager$TreeStrutureNode.apply(AjaxStateManager.java:464)
               at org.ajax4jsf.application.AjaxStateManager.buildSerializedView(AjaxStateManager.java:330)
               at org.ajax4jsf.application.AjaxStateManager.saveSerializedView(AjaxStateManager.java:314)
               at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:600)
               at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
               at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
               at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
               at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
               at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
               at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
               at java.lang.Thread.run(Thread.java:619)
              
              


              It also seems to be more prevalent if I use Facelts compositions or includes.

              Kito D. Mann
              Author, JSF in Action
              http://www.jsfcentral.com

              • 5. Re: duplicate Id for a component error while using RichFaces
                Ilya Shaikovsky Master

                please attach page snippet where the exception occurs.