2 Replies Latest reply on Sep 3, 2009 7:59 AM by Ilya Shaikovsky

    rich:element not working as expected.

    senthil kumar Newbie

      Hi,
      I am trying to use rich:element in javascript as follows

      <a4j:support event="onviewactivated" reRender="zoneContentType" ajaxSingle="true" onsubmit='#{rich:element("zoneContentType")}.style.display="none";#{rich:element("waitmsg")}.style.display="block"' oncomplete="#{rich:element('waitmsg')}.style.display='none'"/>


      This was working perfectly in 3.3.0 . Today i upgraded my libaries to 3.2.2 CR1 and it is giving me the following error,

      16:58:52,695 FATAL [lifecycle] JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /game/addGame.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@cf70e4]
      16:58:52,695 ERROR [BaseXMLFilter] Exception in the filter chain
      javax.servlet.ServletException
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
      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:524)
      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.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:619)
      Caused by: java.lang.NullPointerException
      at org.apache.el.lang.FunctionMapperImpl$Function.writeExternal(FunctionMapperImpl.java:123)
      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
      at java.util.HashMap.writeObject(HashMap.java:1001)
      at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
      at org.apache.el.lang.FunctionMapperImpl.writeExternal(FunctionMapperImpl.java:74)
      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
      at org.apache.el.ValueExpressionImpl.writeExternal(ValueExpressionImpl.java:256)
      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
      at org.apache.jasper.el.JspValueExpression.writeExternal(JspValueExpression.java:129)
      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
      at com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:269)
      at javax.faces.render.ResponseStateManager.writeState(ResponseStateManager.java:166)
      at org.ajax4jsf.application.AjaxStateManager.writeState(AjaxStateManager.java:294)
      at org.ajax4jsf.application.AjaxStateManager.writeState(AjaxStateManager.java:230)
      at com.sun.faces.application.ViewHandlerImpl$WriteBehindStateWriter.flushToWriter(ViewHandlerImpl.java:930)
      at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:210)
      at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
      ... 25 more
      16:58:52,696 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception


      The same code was working in 3.3.0 . Are there any changes or the way i am using it wrong ?

        • 1. Re: rich:element not working as expected.
          senthil kumar Newbie

          And i am getting the following error when i am using rich:clientId

          java.lang.ClassNotFoundException: No ClassLoaders found for: org.richfaces.function.RichFunction
          17:02:33,382 ERROR [STDERR] at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
          17:02:33,382 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
          17:02:33,382 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)


          Caused by: javax.faces.FacesException: org.apache.jasper.el.JspELException: /game/addGameUI.jsp(312,20) 'alert(#{rich:clientId("zoneContentType")})' Function 'rich:clientId' not found
          at org.ajax4jsf.component.html.HtmlAjaxSupport.getOnsubmit(HtmlAjaxSupport.java:467)
          at org.ajax4jsf.component.UIAjaxSupport.getEventString(UIAjaxSupport.java:92)
          at org.ajax4jsf.component.EventValueExpression.getValue(EventValueExpression.java:132)
          at org.richfaces.component.html.HtmlInplaceSelect.getOnviewactivated(HtmlInplaceSelect.java:1528)
          at sun.reflect.GeneratedMethodAccessor277.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1585)
          ... 77 more
          Caused by: org.apache.jasper.el.JspELException: /game/addGameUI.jsp(312,20) 'alert(#{rich:clientId("zoneContentType")})' Function 'rich:clientId' not found
          at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:107)
          at org.ajax4jsf.component.html.HtmlAjaxSupport.getOnsubmit(HtmlAjaxSupport.java:465)
          ... 84 more