6 Replies Latest reply on May 9, 2008 4:55 AM by Colin MacLeod

    RichFaces Java 1.4 Compliance

    Alexander Hachmann Newbie

      Hello,
      I am currently evaluating RichFaces for Use on WebSphere Portal 6.0.
      At first I am Simply trying to create a SandBox in order to test on WAS 6.0 an run into some Version Problems.

      In the class org.richfaces.component.UIComponentControl my WebApp is running in a NoSuchMethodError when using a rich:componentControl.

      In the method getEventString below, RichFaces is calling replace(CharSequence, CharSequence) though this method only exists for tow Char Parameters. This does not run on a Java 1.4 Runtime.

      Has anyone a solution for this Problem, or am I missin something? I need to get this Component run on WAS 6.0 in order to go on using RichFaces on WepSphere Portal.

      Thank you and regards,
      Alexander

      public String getEventString()
       {
       String targetId = HtmlUtil.idsToIdSelector(getFor());
      
       targetId = HtmlUtil.expandIdSelector(targetId, this, FacesContext.getCurrentInstance());
      
       JSFunction invocation = new JSFunction("Richfaces.componentControl.performOperation");
       invocation.addParameter(new JSReference("event"));
       //FIXME: Maksim
       //Replacement looks ugly - move that functionality to HtmlUtil
       invocation.addParameter(targetId.replace("\\\\", "\\"));
       invocation.addParameter(getOperation());
       invocation.addParameter(new JSReference("{" + getEncodedParametersMap() + "}"));
       invocation.addParameter(Boolean.valueOf(isDisableDefault()));
      
       return invocation.toScript();
      
      
       }



      Exception:
      Caused by: java.lang.NoSuchMethodError: java.lang.String: method replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; not found
       at org.richfaces.component.UIComponentControl.getEventString(UIComponentControl.java:53)
       at org.ajax4jsf.component.EventValueBinding.getValue(EventValueBinding.java:92)
       at org.richfaces.component.html.HtmlDataTable.getOnRowClick(HtmlDataTable.java:751)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
       at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
       at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1402)
       ... 61 more


        • 1. Re: RichFaces Java 1.4 Compliance
          Ilya Shaikovsky Master

          3.2.0 will be only JSF 1.2 JDK 1.5 compilant.

          3.1.x branch has 1.4 JSf .1.1 compatibility.

          • 2. Re: RichFaces Java 1.4 Compliance
            Alexander Hachmann Newbie

            We are currently using RichFaces 3.1.4.GA

            And the code snippet is from this release aswell :-/

            Any suggestions?

            thx and regards,
            Alexander hachman

            • 4. Re: RichFaces Java 1.4 Compliance
              Colin MacLeod Newbie

              We still appear to be getting the same issue with RichFaces 3.1.5GA, running against JDK 1.4.2 on WAS 6.0.2. It looks like there's still a problem with the StringBuffer(CharSequence seq) constructor in CompositeRenderer.

              This issue is now listed as fixed - can we use a more recent version of the 3.1.x stream from subversion? If so, what tag do we need to check it out?

              Here's the stack trace:

              java.lang.NoSuchMethodError: java.lang.StringBuffer: method <init>(Ljava/lang/CharSequence;)V not found
               at org.richfaces.renderkit.CompositeRenderer.escapeHtmlEntities(CompositeRenderer.java:244)
               at org.richfaces.renderkit.html.DropSupportRenderer.encodeEnd(DropSupportRenderer.java:110)
               at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:740)
               at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
               at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
               at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:199)
               at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:194)
               at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
               at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:721)
               at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:465)
               at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:253)
               at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:721)
               at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
               at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
               at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
               at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:721)
               at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:629)
               at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:566)
               at com.ibm._jsp._shoppingCartMenu._jspx_meth_a4j_outputPanel_0(_shoppingCartMenu.java:1325)
              ...
              


              • 5. Re: RichFaces Java 1.4 Compliance
                Nick Belaevski Master

                Hello,

                I've created http://jira.jboss.com/jira/browse/RF-3376 on that.

                You can take this: https://svn.jboss.org/repos/richfaces/tags/3.1.5.GA tag and apply a simple change:

                protected String escapeHtmlEntities(CharSequence orig) {
                 StringBuffer buff = new StringBuffer(orig.toString());
                
                instead of:
                protected String escapeHtmlEntities(CharSequence orig) {
                 StringBuffer buff = new StringBuffer(orig);
                in CompositeRenderer class


                • 6. Re: RichFaces Java 1.4 Compliance
                  Colin MacLeod Newbie

                  Right - thanks for that. We've used your workaround in that one class and everything else seems to work OK with 1.4.