7 Replies Latest reply: Jan 14, 2013 12:33 PM by Vickram RSS

    Duplicate submission of request is being invoked automatically - Struts

    Vickram
      Hello All:

      Am struggling with this issue for past 10days. I will explain the issue in detail,I have a button in jsp, onclick it will send the request to someaction.do to generate a report and
      display that report in a new window.After clicking the button to generate the report, in business class a sql query is getting executed,if the query result has less data, then i don't have any problem, i could view my report page.If the query result has more data, then the query takes at least 5-6mins to complete, but before the query completes its execution, again the same request is automatically invoked and it starts from action class, business layer and query execution, because of this the report is not getting generated.
      As multiple time the same request is hit automatically, the browser shows internet explorer error and ends up in a blank page.

      No exception is thrown in the log page, i could find only at the place of query execution it stops and starts as a new request from web.xml with Servlet Filters, Action.

      Note: For a single .do request, the request is getting repeated for 3 times. Overlapping of request also takes place.

      If u couldn't understand my question, kindly ask me. But pls someone help me to fix this issue.

      Thanks in advance.

      Thanks and Regards,
      K.Vickram.
        • 1. Re: Duplicate submission of request is being invoked automatically - Struts
          gimbal2
          Sounds like a request timeout caused by the fact that for some reason your database action is really, really slow. The fact that the request is made three times is odd, it is not regular browser behavior (a browser would report that there is no response). Perhaps you have some browser plugin that retries a request when it fails?

          In any case you should fix the root problem: why is that database query taking so long to complete? It may be that you need proper indexes, or you're getting way more results than you should be getting. If you can't improve the speed of the query you may have to think about implementing the report generation as a background task so the user can download it later once it has finished being created.


          EDIT:

          is this a colleague of yours?

          Multiple time submission of a form automatically in struts
          • 2. Re: Duplicate submission of request is being invoked automatically - Struts
            Vickram
            Hi gimbal2 ,

            Thanks for your quick response . Yes she is my colleague.

            The other thing which i forgot to mention in the last thread was :

            Our application has two different URL's to login

            First URL details and request flow
            When we hit the URL the request goes to a LDAP server for authentication and then to LoadBalancer and then to our Application server which is weblogc 10.3.2

            Second URL details and request flow
            When we hit the URL the request goes directly to Application server which is weblogc 10.3.2 ( here the authentication and LoadBalancer is bypassed )

            The problem ( report is not generating ) is lying only while logging with First URL , the same is working in Second URL

            Perhaps you have some browser plugin that retries a request when it fails?
            -- We are accessing the application in IE 8 and 9 and we have not added any plugins from our end.


            The request flow for the report is

            Filter classes - > action classes - > Business layer classes - > db layer classes and vice versa for backward

            Filter is configured for *.do in web.xml ( <url-pattern>*.do</url-pattern> )

            For a single .do request, filter is getting invoked for 3 times and hence the request is being invoked for 3 times from action to db layer .

            The below steps are for the single .do execution for the First URL where the report is not generated

            Step 1 ( first request )
            Filter is invoked and request started and gets halted at a particular query ( Adhoc Report Display Query : )
            Step 2 ( second request )
            Then again filter gets invoked which causes to create the new request for the same .do and then it gets halted in another query ( Adhoc Report Count Query(length = zero) : )
            Step 3
            Then pending code execution for the first request gets completed
            Step 4 ( third request )
            Again filter invoked which causes to create another new request for the same .do and then it gets halted in another query ( Adhoc Report Display Query : )
            Step 5 ( fourth request )
            Again filter invoked which causes to create another new request for the same .do and then it gets halted in another query ( Adhoc Report Display Query : )
            Step 6
            Then pending code execution for the third request gets completed
            Step 7
            Then pending code execution for the fourth request gets completed
            Step 8
            Then pending code execution for the second request gets completed


            yes we have background task for report generation which has more than 3000 records , four our issue case we have only 2000 records

            Appreciate ur fast help as we are in an urgent situation to fix this production issue.

            thanks in advance

            Thanks and Regards
            Vickram
            • 3. Re: Duplicate submission of request is being invoked automatically - Struts
              Vickram
              Hello :

              Please help me to fix the issue

              Thanks and Regards
              K.Vickram
              • 4. Re: Duplicate submission of request is being invoked automatically - Struts
                gimbal2
                Sorry, I don't have access to your environment so there is nothing I can do. On top of that I don't know anything about Weblogic. Perhaps people that hang around in the Weblogic forum have a clue. It might be that you'll need to hire an expert to investigate for you.

                https://forums.oracle.com/forums/category.jspa?categoryID=193

                If you post there be sure to mention you posted here as well (with link to this thread); otherwise people will assume you are cross-posting and that is not something that is appreciated.
                • 5. Re: Duplicate submission of request is being invoked automatically - Struts
                  ramp
                  First of all eliminate the possibility that the request is being issued by the browser. Use a tool like httpfox, firebug or fiddler on your browser to examine http request history.

                  Once that is done, examine your code to check if there are multiple threads being invoked to generate different parts of the report (I am just guessing here). Examine your web.xml to check if includes and forwards invoke the filter (by default they do not). As the previous poster remarked, we do not have access to your source code. You should be doing the debugging.
                  • 6. Re: Duplicate submission of request is being invoked automatically - Struts
                    Vickram
                    Hi Ramp,

                    We are using ieHTTPHeaders to track them

                    We are not using threads to invoke the report and i am working this issue in my test environment and no one is using apart from me while i am testing .

                    Filter is configured for only .do . It is not invoked for includes and forward

                    <filter-mapping>
                    <filter-name>WebsealRequestFilter</filter-name>
                    <url-pattern>*.do</url-pattern>
                    </filter-mapping>

                    I am getting confused as it working in Second URL , will there be a code issue

                    First URL details and request flow
                    When we hit the URL the request goes to a LDAP server for authentication and then to LoadBalancer and then to our Application server which is weblogc 10.3.2

                    Second URL details and request flow
                    When we hit the URL the request goes directly to Application server which is weblogc 10.3.2 ( here the authentication and LoadBalancer is bypassed )

                    The problem ( report is not generating ) is lying only while logging with First URL , the same is working in Second URL

                    Filter is getting invoked automatically and overlapping of request is also happening

                    The below steps are for the single .do execution for the First URL where the report is not generated

                    Step 1 ( first request )
                    Filter is invoked and request started and gets halted at a particular query ( Adhoc Report Display Query : )
                    Step 2 ( second request )
                    Then again filter gets invoked which causes to create the new request for the same .do and then it gets halted in another query ( Adhoc Report Count Query(length = zero) : )
                    Step 3
                    Then pending code execution for the first request gets completed
                    Step 4 ( third request )
                    Again filter invoked which causes to create another new request for the same .do and then it gets halted in another query ( Adhoc Report Display Query : )
                    Step 5 ( fourth request )
                    Again filter invoked which causes to create another new request for the same .do and then it gets halted in another query ( Adhoc Report Display Query : )
                    Step 6
                    Then pending code execution for the third request gets completed
                    Step 7
                    Then pending code execution for the fourth request gets completed
                    Step 8
                    Then pending code execution for the second request gets completed


                    Please help me .

                    Thanks and Regards
                    K.Vickram
                    • 7. Re: Duplicate submission of request is being invoked automatically - Struts
                      Vickram
                      Hi Ramp,

                      Is there any paramter needs to edited in weblogic 11g

                      I was able to see same kind of issue in other person threads also

                      Other thread link is below

                      http://stackoverflow.com/questions/12930912/duplicate-request-in-web-logic-server-11g-after-every-5-mins

                      Please help me

                      Thanks and Regards
                      K.Vickram