10 Replies Latest reply on Mar 14, 2008 9:25 PM by sergeysmirnov

    Application stability issues


      Hello everyone,
      Though my application was released some 5 months back now, but I know there are certain strange stability issues.

      Here is the env:
      OAS 10.1.2 (OC4J 10.1.3)
      richFaces 3.1.4 GA
      Tomahawk 1.1.6

      Here is brief detail about application design:
      Its is one page application. So basically parts of pages are getting repainted based on different kinds of requests. Every submit is an ajax submit. When a user clicks on the link to application i.e he invokes http://.. /.. /faces/index.jsp. In here I call the database and put the results in session.
      Here is the code of index.jsp:

       <body onload="loadInitialData()"><h:form id="form1">
       <a4j:jsFunction name="loadInitialData" id="loadFunction" action="#{startBean.loadSession}"/>
       <h:inputHidden id="ibmessage" value="#{startBean.loadMessage}" />
       <h:inputHidden id="LoginHome" value="#{startBean.LoginHome}" />

      Though loadFunction I called using jsFunction, but it returns either success or failure which determines which page to redirect to.

      This result from loadFunction will have the data to pre-populate many drop-downs and text-boxes in next page. Now the page is redirected to
      http://.. /../faces /search.jsp (the next page)
      Search.jsp has has following displayed by default:

      - Header
      - A bar which acts like a tab holder (it hides/shows different divs)
      - 2 more section below it which basically perform search and take you to next sections.

      I have done all sorts of exception handling and I use A4J.AJAX.onExpired to catch session timeout. I also use A4J.AJAX.onError to catch any JSP error.

      Now here are the issues:
      1) Many a times first page load is not complete (happens when link to index.jsp is called). Only the header and bar below will show up.

      2) At times ( rarely though usually when application is left unattended for long time) I get javax.faces.el.EvaluationException: java.lang.NullPointerException can not find "countries"
      Please note that countries is a dropdown whose value was coming from
      loadFunction in index.jsp. It was put in session in index.jsp. Drop-down in search.jsp used values from this session to populate countries drop-down. Neither A4J.AJAX.onExpired nor A4J.AJAX.onError catch it. It comes on the page as server 500 error.

      3) Whenever some button is clicked I start showing a spinning wheel till the response comes back. At times wheels is just spinning for long time and nothing is happening. What I observed at times the ajax action is not at all getting called. Lets say if this was the command button:

      <a4j:commandButton id="commandButton3" action="#{backing_CustSearchBean.serchCustomer}"
      reRender="searchForm, form1, qcForm, rtform:cartForm" image="images/btn_search.gif" onclick="showWheel();this.disabled='true';"

      Then only onclick is invoked so the spin wheel is showing but it never actually made to action. Hence even oncomplete functions are not triggered and so nothing stops the spinning wheel.

      Any idea on why these issues might be occurring will be highly appreciated. Please help!

        • 1. Re: Application stability issues

          'this' inside the oncomplete call does not point to the button as far as the oncomplete code is delegated to the Ajax object to invoke. So, if you want to set the 'disable' to false, assign any JS variable to 'this' in the 'onclick'.
          Does the button inside h:form and no other h:form nested?

          • 2. Re: Application stability issues

            Yes I use JS function only for enabling buttons in oncomplete event.

            Yes all the buttons are inside <h:form> and none of the forms are nested.

            • 3. Re: Application stability issues

              You first answer made me lost. oncomplete="this.disabled='false',handleSearchCustEvents();" sounds like you not only enable the button (potentially unsuccessful ), but also handle Search Cust Events.

              Whatever. It does not matter does the action method is called or not, the oncomplete should be invoked in any cases.
              Do you see that Ajax request goes to the server?

              • 4. Re: Application stability issues

                I think Ajax request wasn't going to server. If you re-hit the button though, everything works fine again.

                But it's kind of strange. I don't know under what situations request would not go to server. That too randomly.

                • 5. Re: Application stability issues


                  "icai" wrote:
                  I think Ajax request wasn't going to server. If you re-hit the button though, everything works fine again.

                  This is not a right way to prove.

                  Do you use a FireFox with FireBug, if so, look at the console. Is the Ajax request sent each time you click the button?

                  • 6. Re: Application stability issues

                    This behavior is very Random and occurs once in 40 times, that too I never came across it, in my local environment. May be because I restart the server every so often.

                    Can you please tell me what can be such situations where a request will not go to server?

                    • 7. Re: Application stability issues

                      I do not believe in miracles. Everything should have a rational explanation. I do not understand yet what you are doing wrong on your side. So, I cannot explain the case until it is clear.

                      Let's return back to the main stream. Do you use FireFox with FireBug?

                      • 8. Re: Application stability issues

                        I use Safari. Do you suggest that I test application using firebug?

                        • 9. Re: Application stability issues

                          I just saw this a4j exception in firebug :

                          uncaught exception: Permission denied to get property HTMLDivElement.parentNode
                          getElementsByTagName("INPUT", span#ajax-view-state)a4j_3_1_4.GAorg.a... (line 904)
                          processResponse(Object _query=Object _documentElement=html options=Object)a4j_3_1_4.GAorg.a... (line 1491)

                          There are other errors as well but those are

                          event is not defined
                          (no name)()search.jsp (line 3174)
                          [Break on this error] <tr>

                          • 10. Re: Application stability issues

                            http://jira.jboss.com/jira/browse/RF-2532 has been created regarding this exception.

                            However, it might be specific for FireFox, but not about your problem.