aspose file tools*
The moose likes Servlets and the fly likes Another double execution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Another double execution " Watch "Another double execution " New topic
Author

Another double execution

Daniel Morgan
Greenhorn

Joined: Oct 11, 2011
Posts: 4
Hello guys!

First of all, I researched a lot about this problem and didn't find anything that would apply specifically to my problem.

Let me explain it. I have a project that uses Struts, EJB and JSP running on websphere (5.1.2). In a specific JSP page, there is a button that submit de request to an action. That takes a lot to run, about 2 minutes. My problem is that this action is being performed twice in an interval of 60 seconds between them. It is exactly 60 seconds, and always in the period in which the page is blocked, preventing any user action.

I already checked the most common errors in pages that do not contain the src tag, or '# links but they do not apply.

Anyone have any ideas to help?

Thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Is there a meta refresh tag on the page causing a refresh? What about script?

Have you used an HTTP monitor to see if the request has any clues in it as to who/why it's being generated?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

P.S. 2+ minutes is a long time (way too long) to make someone wait for a response. I'd recommend investigating an asynchronous approach that offers better usability.
Daniel Morgan
Greenhorn

Joined: Oct 11, 2011
Posts: 4
Bear Bibeault wrote:Is there a meta refresh tag on the page causing a refresh? What about script?

Have you used an HTTP monitor to see if the request has any clues in it as to who/why it's being generated?



No, there is not. And the strangest thing is that this is only occurring for one user, and only in the testing environment. I run the application locally and this error never occurs on my server.

Oh, I forgot to mention that I checked the log, and saw that the request is initiated by a second thread, but contain the same data the first request sent.



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Sounds like something environmental to that one tester. Has he or she tried this in different browsers? From different systems?
abani patra
Ranch Hand

Joined: Oct 11, 2011
Posts: 70
Hi,
Please use Firefox and download firebug to detect the issue.
Daniel Morgan
Greenhorn

Joined: Oct 11, 2011
Posts: 4
Sorry the delay, but I did interesting tests . First, I discovered that the problem is not in the browser of the tester. I took my computer with the same ear file deployed, and the error didn't occur. Then I checked how the system was configured on the tester machine and found that there the system is being directly deployed in websphere application server (I use WSAD).

But I'm not familiar with websphere application server configuration. My suspicion is that there is some service in some layer of the server that is storing the first request made, and submit it again after timeout. But I really don't know where is this configuration...
Matthew Freake
Greenhorn

Joined: Oct 26, 2011
Posts: 2
Does the tester access the servlet via a proxy? I've had production issues where a proxy would re-request a URL if it took longer than a certain time period.
Ove Lindström
Ranch Hand

Joined: Mar 10, 2008
Posts: 326

Matthew Freake wrote:Does the tester access the servlet via a proxy? I've had production issues where a proxy would re-request a URL if it took longer than a certain time period.


I second that!

We are facing problems with a new proxy that hogs the request. When using the dev-net we are accessing directly to servers and databases but on the test-net they use a local-fw -> proxy -> net-fw -> dev-net.

Temporary solution was to add the dev-net servers in "no proxy for...".
Daniel Morgan
Greenhorn

Joined: Oct 11, 2011
Posts: 4
I finally found the error. It was in the websphere application server configuration. I really don't know almost nothing of the WAS configuration, but after a lot of research in the IBM manuals, I found out that there is a ServerIOTimeout parameter used for failover, which according to the manual resends requests before start the failover. The default setting is 60 seconds, and this is what was causing the problem.

Weird or not? I doubt that I was the first one to have duplicate requests because this parameter...

Anyway.. thank you all!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Another double execution