4 Replies Latest reply on Nov 28, 2007 8:55 AM by Eivind Rønnevik

    ajax4jsf throws

    Eivind Rønnevik Newbie

      Hi!

      I'm having some problems in my web-application. Every time if I refresh the browser, both with F5 and with ctrl+F5 (to clear browser cache),
      I get the "java.lang.IllegalStateException: duplicate Id for a component......" exception. This also happens sometimes when I do partial reRendering of a page.

      I'm quite sure I manually have assigned Id's to all the components, so Jsf doesn't generate them for me. This is an example of the exception I get:

      2007-11-28 14:06:22,156 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/K-search].[Faces Servlet]] Servlet.service() for servlet Faces S
      ervlet threw exception
      java.lang.IllegalStateException: duplicate Id for a component searchForm:searchBar
       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$TreeStrutureNode.apply(AjaxStateManager.java:464)
       at org.ajax4jsf.application.AjaxStateManager.buildSerializedView(AjaxStateManager.java:330)
       at org.ajax4jsf.application.AjaxStateManager.saveSerializedView(AjaxStateManager.java:314)
       at org.apache.myfaces.taglib.core.ViewTag.doAfterBody(ViewTag.java:125)
       at org.apache.jsp.jsp.protected_.K_002dsearch_jsp._jspService(K_002dsearch_jsp.java:729)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
       at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
       at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
       at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       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:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at com.kadme.ksearch.web.filter.FilterUTF8.doFilter(FilterUTF8.java:31)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:393)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:595)


      My enviroment is:
      - myfaces 1.1.5
      - tomahawk 1.1.5
      - richfaces 3.1.2 GA
      - jdk1.5.0_13
      - jre1.6.0_03
      - jboss-4.2.2.GA

      I use server as STATE_SAVING_METHOD if this is of importance.


      Does anybody have a clue about this?

      Help would be appreciated!

      Thanks!

      Regards,

      Eivind Roennevik



        • 2. Re: ajax4jsf throws
          Eivind Rønnevik Newbie

          This is my "main"-page, but it also includes content and other .jsps. I don't use any a4j-components, but use some of the richFaces-components.

          <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
          <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
          <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
          <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
          <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
          
          <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
          <%@page import="com.kadme.ksearch.web.faces.handlers.navigate.SearchHandler"%>
          <f:view >
          
          
          
           <t:document>
          
           <t:documentHead>
           <f:loadBundle basename="MessageResources" var="messages" />
           <title><h:outputText value="#{messages.headerTitle}" /> </title>
           <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/styles.css" />
           <script type="text/javascript" src="${pageContext.request.contextPath}/javascript/javascript.js"></script>
           </t:documentHead>
          
           <f:verbatim>
           <body style="margin: 0px; padding: 0px; z-index: 0" >
           </f:verbatim>
          
           <rich:modalPanel id="mp" minHeight="200" minWidth="450"
          
           height="400" width="700" zindex="2000">
          
           <f:facet name="header">
          
           <h:outputText value="#{messages.advancedSearchHeader}" />
          
           </f:facet>
          
           <f:facet name="controls">
          
           <h:graphicImage value="/images/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
          
           </f:facet>
           <h:form id="advancedSearchForm">
           <h:panelGrid id="toolBarIncludedPage">
           <jsp:include flush="true" page="${rangedSearchHandler.advancedSearchJsp}"></jsp:include>
          
           </h:panelGrid>
           </h:form>
          
           </rich:modalPanel>
          
          
           <h:panelGrid id="headerPanel" width="100%">
           <h:form>
           <jsp:include page="headerFrame.jsp"/>
           </h:form>
           </h:panelGrid>
          
           <t:panelGrid forceId="true" id="borderPanel" align="center" width="95%" columns="1">
           <h:panelGrid id="loginAndStatusPanel" align="right">
          
           <h:form id="statusForm">
           <f:subview id="status" >
           <jsp:include page="K-search_status.jsp"/>
           </f:subview>
           </h:form>
          
           </h:panelGrid>
          
           <h:panelGrid id="logoAndSearchPanel" align="center" width="100%" columns="2" columnClasses="kSearchLeftHeader, kSearchMainHeader">
          
           <jsp:include page="logo.jsp"/>
          
          
           <h:panelGrid id="rangedBarANdSearchPanel" columns="1" align="center" width="100%">
          
          
          
           <h:panelGrid id="searchPanel" columns="1" width="100%" align="left">
          
           <h:form id="searchForm">
           <h:panelGrid columns="2">
           <jsp:include flush="true" page="searchBarFrame.jsp"></jsp:include>
           <jsp:include flush="true" page="rangedToolBar.jsp"></jsp:include>
           </h:panelGrid>
           </h:form>
          
           <h:panelGrid columns="1">
           <h:form id="searchLinks">
           <jsp:include flush="true" page="searchLinks.jsp"></jsp:include>
           </h:form>
           </h:panelGrid>
           </h:panelGrid>
           </h:panelGrid>
          
           </h:panelGrid>
          
           <h:panelGrid id="menuAndMainPanel" align="center" width="100%" columns="2" styleClass="headerNull" columnClasses="kSearchLeft, kSearchMain">
          
          
           <h:panelGrid id="menuPanel" width="100%" styleClass="kSearchDataGrid" columnClasses="noPaddedTable">
          
           <h:panelGrid columns="1" width="100%" styleClass="noPaddedTable" columnClasses="noPaddedTable">
          
           <h:form id="menuForm" styleClass="noPaddedTable">
           <jsp:include flush="true" page="leftFrame.jsp"/>
           </h:form>
          
           </h:panelGrid>
          
          
          
          
           </h:panelGrid>
          
          
           <h:panelGrid id="mainFormPanel" width="100%" styleClass="noPaddedTable" columnClasses="noPaddedTable">
          
           <h:form id="mainForm" >
          
           <%
          
           javax.faces.context.FacesContext context = javax.faces.context.FacesContext.getCurrentInstance();
           SearchHandler searchHandler = (SearchHandler) context.getApplication ().getVariableResolver().resolveVariable(context,"searchHandler");
          
          
           %>
          
           <t:panelGrid columns="1" styleClass="noPaddedTable" columnClasses="noPaddedTable" width="100%">
          
           <t:div id="mainContainer" styleClass="content">
           <f:subview id="contentIncluded">
          
           <jsp:include flush="true" page="${searchHandler.selectedJsp}"></jsp:include>
           </f:subview>
           </t:div>
          
           </t:panelGrid>
          
          
           </h:form>
           <h:form id="setSpecificForm">
           <h:inputText value="#{searchHandler.scrollTop}" id="scrollTopParam" style="display: none;"></h:inputText>
           </h:form>
           <jsp:include flush="true" page="footerFrame.jsp"/>
          
           </h:panelGrid>
          
           </h:panelGrid>
           </t:panelGrid>
           <t:panelGroup id="modelViewPanelMain" rendered="#{searchHandler.specificDomain != null}">
          
           <t:div forceId="true" id="overlay" style="visibility: hidden" ></t:div>
           <f:verbatim>
           <script type="text/javascript">
          
           setOverlay(pageDimensionX(),pageDimensionY(),${searchHandler.scrollTop});
           </script>
           </f:verbatim>
          
           <t:div forceId="true" id="blueTransparent" style="visibility: hidden" ></t:div>
           <f:verbatim>
           <script type="text/javascript">
           setBlueTransparent(pageDimensionX(),pageDimensionY(),${searchHandler.scrollTop});
           </script>
           </f:verbatim>
           <t:div>
           <jsp:include page="specificView.jsp"/>
           </t:div>
           </t:panelGroup>
          
          <f:verbatim>
           </body>
          </f:verbatim>
          
          </t:document>
          
          </f:view>
          


          • 3. Re: ajax4jsf throws
            Ilya Shaikovsky Master

            Show included search bar also please.

            • 4. Re: ajax4jsf throws
              Eivind Rønnevik Newbie

              My searchBar.jsp

              <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
              <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
              <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
               <%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
              <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
              <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
              
              <t:panelGrid id="searchBarMainPanel" columns="1">
              
              
               <t:panelGroup id="searchBarPanelGroup1">
              
               <h:inputText value="#{searchHandler.query}" id="queryString" styleClass="K-searchQueryBox" />
              
               <t:inputText style="display: none; visibility: hidden" value="" ></t:inputText>
               <t:commandButton id="searchButton" action="#{searchHandler.search}" type="submit" value="#{messages.searchTag}">
               <t:updateActionListener value="false" property="#{searchHandler.fromSearchHistory}"></t:updateActionListener>
               </t:commandButton>
              
               </t:panelGroup>
              
              </t:panelGrid>