4 Replies Latest reply on Mar 27, 2014 6:54 AM by tom_s

    broken ajax on Richfaces 4.3.[1|2] with Myfaces 2.1.x

    dageisz

      Hi,  i wonder if anyone else had problems upgrading to richfaces 4.3.1.Final or 4.3.2.Final when using Myfaces JSF implementation.  In my case i was using Myfaces 2.1.10 omnifaces 1.5 richfaces 4.3.0.Final  and everything was ok, but when upgrading to 4.3.1.Final or 4.3.2.Final all ajax requests where broken. After a couple of trys i saw that the response xml was broken, the closing tags for  and  where missing.  Can anyone confirm this?  Same application but with mojarra works with the current richfaces version.

        • 1. Re: broken ajax on Richfaces 4.3.[1|2] with Myfaces 2.1.x
          jhuska

          Hello,

           

          we have not noticed any issues using RichFaces 4.3.1.Final with MyFaces 2.1.x. However, I did not try it together with Omnifaces. Have you resolved your issue already ?

           

          It would be also helpful if you find out whether it is Omnifaces integration problem or not.

           

          If you are still struggling with this, try to minimize the example so we can try to reproduce the issue on it. Provide us with more details like what Servlet container/ Application container are you deploying your application on, browser, etc.

          • 2. Re: broken ajax on Richfaces 4.3.[1|2] with Myfaces 2.1.x
            dageisz

            Hello,

             

            i m affraid i haven't solved the issue, we just migrated to mojarra for better compilance.

            At least my tests with the little project i attached showed that it seems to be the combination of those 3 frameworks, as without omnifaces it's working fine:

             

            These are the corresponding ajax responses (taken from dev tools of google chrome after clicking the link:

             

            without omnifaces (everthing is ok):

             

            <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="j_id_5:thisGrid"><![CDATA[<table id="j_id_5:thisGrid"><tbody>
            <tr><td>this is my text</td></tr>
            </tbody>
            </table>]]></update><update id="javax.faces.ViewState"><![CDATA[n/qczoZgRcmZjtsIBVW+kC8Pl4SePcNBoDK3Qbr7Q1XLQ9p5]]></update><extension id="org.richfaces.extension"><render>j_id_5:thisGrid</render></extension></changes></partial-response>
            
            

             

            with omnifaces (response is broken, cause of missing closing tags):

            <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="j_id_5:thisGrid"><![CDATA[<table id="j_id_5:thisGrid"><tbody>
            <tr><td>this is my text</td></tr>
            </tbody>
            </table>]]></update><update id="javax.faces.ViewState"><![CDATA[ybgptVBzqaLwfgo/EQuxjRpR13Bv+I8Bx7HV5/pP21kwm3Os]]></update><extension id="org.richfaces.extension"><render>j_id_5:thisGrid</render></extension>
            
            

             

            I was using omnifaces before and had no problems on Richfaces 4.3.0.Final, it's a bit confusing to see it broken with 4.3.1.Final and 4.3.2.Final.

             

            The used container is oracle weblogic 10.3.5 (thats why there is a weblogic.xml to be able to use el 2.2).

             

            I hope this helps.

            • 3. Re: broken ajax on Richfaces 4.3.[1|2] with Myfaces 2.1.x
              bauke

              This problem is caused because RichFaces thinks that it's the only JSF library ever being used in a JSF web application and is not doing anything in the "else" condition of ExtendedPartialViewContextImpl#finallyEndDocumentWrappedMode() when the (possibly wrapped) partial response writer does not seem to be an instance of their own implementation.

               

              See also https://code.google.com/p/omnifaces/issues/detail?id=191

              • 4. Re: broken ajax on Richfaces 4.3.[1|2] with Myfaces 2.1.x
                tom_s

                Hi

                We had the same issue with MyFaces 2.0.16, Richfaces 4.3.1 and Omnifaces 1.4.1. (JDK1.6 and 1.7)

                But the Code used to work. It suddenly stopped working some time ago on Mac and Windows developing environments using maven jetty 6.1.26 (nothing changed) and kept working on ubuntu using the same svn checkout.

                Debugging showed, that on Mac / Windows the OmniPartialViewContextFactory has been loaded when starting the server. On Ubuntu, the MyFaces PartialViewContextFactoryImpl was loaded.

                The Bug seems to be fixed in Richfaces 5.0.0Alpha3?

                To take the risk out of production we deactivated omnifaces (a pitty). Or is there a way to control the loading of javax.faces.context.PartialViewContextFactory?

                Thanks Tom