3 Replies Latest reply on Nov 2, 2012 5:43 AM by Sanjeev Shrestha

    Richfaces 4 fails to load resources

    Pelle Fridberg Newbie

      I have updated an old JSF project to use JSF 2, Richfaces 4 and it is running in a Tomcat 7 environment.

       

      I have managed to get almost everything running as expected but I have some errors that I can not figure out what could be the problem.

      The hard thing is that I can also not predict when the erros will occur or where.

      The symptoms I get is that sometimes images, flash files or javascripts wont get loaded. If I refresh the page it works. If I go to the same page some other time it works. But then maybe another image in another page wont get loaded. It is, as I see it, totally random.

      Javascripts that belongs to Richfaces components may fail as well sometimes. The following is just examples how it may look in the console log. A refresh in the page will make it work though,

      'richfaces.Event' is null or not an object  tree.js.jsf?ln=org.richfaces, line 189 character 17

      'richfaces.Event' is null or not an object  tree.js.jsf?ln=org.richfaces, line 189 character 17

      'richfaces.Event' is null or not an object  tree.js.jsf?ln=org.richfaces, line 451 character 17

      'RichFaces' is undefined  richfaces-queue.js.jsf, line 5 character 1

      Object doesn't support this property or method  tree.js.jsf?ln=org.richfaces, line 324 character 17

      Object doesn't support this property or method  tree.js.jsf?ln=org.richfaces, line 324 character 17

      Object doesn't support this property or method  tree.js.jsf?ln=org.richfaces, line 324 character 17

      Object doesn't support this property or method  richfaces-base-component.js.jsf, line 229 character 17

      Object doesn't support this property or method  richfaces-base-component.js.jsf, line 229 character 17

      Object doesn't support this property or method  richfaces-base-component.js.jsf, line 229 character 17

      Object doesn't support this property or method  richfaces-base-component.js.jsf, line 229 character 17

      Object doesn't support this property or method  richfaces-base-component.js.jsf, line 229 character 17

      Object doesn't support this property or method  richfaces-base-component.js.jsf, line 229 character 17

      Object doesn't support this property or method  richfaces-base-component.js.jsf, line 229 character 17

      Object doesn't support this property or method  richfaces-base-component.js.jsf, line 229 character 17

      'jQuery.url' is null or not an object  archive.jsf, line 28 character 17

      Object doesn't support this property or method  archive.jsf, line 347 character 1

       

      I have tried to use wireshark to see any errors but without luck.

      I know it might be hard for you guys out there to give me a solution but if you just could hint me in what direction I should go i would appreciate it a lot.

      If I can provide more information to you, just let me know.


        • 1. Re: Richfaces 4 fails to load resources
          Sanjeev Shrestha Novice

          Hi Pelle,

           

          This normally happens when you update Richfaces and JSF. It happened to me a countless times. So you have to be careful. This implies your Richfaces javascript resources are not loading.

           

          You need to have the <h:head> tag.

          Then the other issue is you html content maybe trucated.(This was the issue for me)

          The other thing to look for is to be see if you have imported previous Richfaces Javascript explicitly.(This cause problems.)

          Please dont try to load jquery library explicitly.

           

          My best advice is to use firebug for debugging which helped me find the source of these errors. Try it and see if all the resources have loaded correctly.

           

          All the best.

           

          -Sanjeev

          • 2. Re: Richfaces 4 fails to load resources
            Pelle Fridberg Newbie

            After som more investigations and troubleshooting I was able to find the problem.

            My webapp uses Single Sign On with NTML for authentication and I was able to see that this negotioation wasn't allways working. With some Wiresharking I saw that sometimes when images, flashfiles or javascripts should be fetched from the server the NTLM Type 3 message was missing. Since NTML is connection oriented it requires that the connection has the Keep Alive attribute set but in Wireshark I saw that the Connection had the value "close".

            So the error was that I was running out of available connections.

            After some tuning with the Tomcat Connector parameters in its server.xml I was able to get the application to run smoothly without broken images or failed javascripts.

            The Connector parameters that I was tuning was connectionTimeout and maxKeepAliveRequests. from the beginning I had not set the maxKeepAliveRequests so tomcat used the default value of 100. connectionTimeout is set to 20 seconds in the bundled server.xml.

            <Connector port="80" protocol="HTTP/1.1" connectionTimeout="10000" redirectPort="8443" maxKeepAliveRequests="1000"/>

            • 3. Re: Richfaces 4 fails to load resources
              Sanjeev Shrestha Novice

              Nice to know that you solved the problem. The problem might have been very frustrating. Seems like you must have worked very very hard.

              -Sanjeev