2 Replies Latest reply on Jun 16, 2011 6:42 AM by Saroj Padhy

    Duplicate components created on AJAX request, exception error occurs. (Richfaces 4)

    Saroj Padhy Novice

      Hi All,

       

      I am using Richfaces-4.0.1SNAPSHOT,JSF(Mojara)-2.0.3,Tomcat-6.0.20

       

      If anyone faced this problem, UI components being created again and again on AJAX request! And because of this duplicate Id exception occurs. I had a project with Richfaces3.3.3 and migrating to Richfaces4 is giving lots of problem!

       

      Any suggestions!

       

       

      java.lang.IllegalStateException: Component ID MainForm:B4OF_0 has already been found in the view.  
          at com.sun.faces.util.Util.checkIdUniqueness(Util.java:820)
          at com.sun.faces.util.Util.checkIdUniqueness(Util.java:804)
          at com.sun.faces.util.Util.checkIdUniqueness(Util.java:804)
          at com.sun.faces.util.Util.checkIdUniqueness(Util.java:804)
          at com.sun.faces.application.view.StateManagementStrategyImpl.saveView(StateManagementStrategyImpl.java:134)
          at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:126)
          at javax.faces.application.StateManager.getViewState(StateManager.java:525)
          at org.richfaces.context.ExtendedPartialViewContextImpl.renderState(ExtendedPartialViewContextImpl.java:384)
          at org.richfaces.context.ExtendedPartialViewContextImpl.processPartialRenderPhase(ExtendedPartialViewContextImpl.java:287)
          at org.richfaces.context.ExtendedPartialViewContextImpl.processPartial(ExtendedPartialViewContextImpl.java:206)
          at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:968)
          at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643)
          at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:378)
          at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
          at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:269)
          at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:269)
          at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
          at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)
          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.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
          at java.lang.Thread.run(Unknown Source)
      Jun 15, 2011 12:50:56 PM org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet Faces Servlet threw exception
      java.lang.IllegalStateException: CDATA tags may not nest
          at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.startCDATA(HtmlResponseWriter.java:626)
          at javax.faces.context.ResponseWriterWrapper.startCDATA(ResponseWriterWrapper.java:168)
          at javax.faces.context.PartialResponseWriter.startError(PartialResponseWriter.java:338)
          at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:196)
          at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:119)
          at com.wmdata.b4.webdisplay.CustomExceptionHandler.handle(CustomExceptionHandler.java:54)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:115)
          at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)
          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.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
          at java.lang.Thread.run(Unknown Source)
      

       

       

      And sometimes I get the following exception:

       

      Jun 15, 2011 1:13:51 PM org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet Faces Servlet threw exception
      java.lang.NullPointerException
          at com.sun.faces.application.view.StateManagementStrategyImpl$3.invokeContextCallback(StateManagementStrategyImpl.java:302)
          at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1281)
          at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:673)
          at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1290)
          at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:673)
          at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1290)
          at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:673)
          at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1290)
          at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:673)
          at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:297)
          at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177)
          at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119)
          at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:438)
          at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:144)
          at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:284)
          at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:284)
          at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:182)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
          at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
          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.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
          at java.lang.Thread.run(Unknown Source)
      

       

      Anyone can explain what could be wrong in the code!

       

       

      Thanks in advance,

      Saroj