Author Topic: Problem with router.updateInterval not occurring  (Read 25111 times)

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #15 on: March 26, 2009, 09:50:41 AM »
Absolutely.

aevett

  • Customer
  • Sr. Member
  • *
  • Posts: 482
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #16 on: March 30, 2009, 12:08:59 PM »
We're having some trouble with this change.  For this change to work, do we still need to add the redirect you mentioned earlier in this thread?  If so, does it go in RouterRequestFilter.postProcessRequest?

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #17 on: March 30, 2009, 12:18:19 PM »
No, you shouldn't have to implement anything. The way it should work is, if a request with URL parameter was submitted to AjaxSwing, it would emulate the action, then send a redirect, and then do the rendering. So if something like this was sent:

http://localhost:8040/ajaxswing/apps/WindowsThemeDemo?param=test

then after the whole cycle the URL should remain as

http://localhost:8040/ajaxswing/apps/WindowsThemeDemo

and the application should still be in AJAX mode. If this is not what you are seeing, please capture the logs and attach them to this post.


aevett

  • Customer
  • Sr. Member
  • *
  • Posts: 482
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #18 on: March 31, 2009, 08:39:15 AM »
With the latest patch from CreamTec and with html.disableAjax=false, the following problems are observed.

• Right-click menus in general are problematic.  Their results are not consistent however.  The following was observed.
    o most of the time, it simply hangs the browser.
    o sometimes the right click menu doesn’t “stick” – the right-click menu displays briefly but disappears before you can select a menu item.  This condition does not cause the browser to hang.
    o once, it was observed that the right-click menu basically worked; but you still needed to click twice.

• Pushbuttons exhibit similar issues as right-click menus, and their results are not consistent.  For the File Transfer History, “Refresh”, “Filter” and “Generate Report” buttons, the following was observed.  (all other buttons seems to operate correctly)
    o most of the time, it simply hangs the browser.
    o sometimes, clicking on the button does not hang the browser; but the action is simply ignored.

Attached is a zip file containing the debug for a right-click, hang-up problem.  The following steps were taken:
1. Bring up portal
2. Bring up ManualFileTranfser frame
3. Right-click an item in the table…right click menu is displayed, but browser is now hung
4. Wait ~20 seconds
5. Kill the browser and shut down the service

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #19 on: March 31, 2009, 06:46:46 PM »
It is not obvious from the logs what's causing the browser to hang. We've added some logging and made a slight change in how the refresh is issued. Can you please try with the following jars and let us know if this resolved the problem? If not, please send the logs again.

http://creamtec.com/products/ajaxswing/install/2.4.1/ajaxswing.jar.jdk1.5
http://creamtec.com/products/ajaxswing/install/2.4.1/asboot.jar.jdk1.5

aevett

  • Customer
  • Sr. Member
  • *
  • Posts: 482
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #20 on: April 01, 2009, 10:40:15 AM »
With the new jars, things don't appear any better.  Now we get hung up trying to bring up either of the frames.  Here are steps corresponding to the attached debug.

1. Bring up portal
2. Click on Manual File Transfer menu item...frame never displayed...browser seems to be looping
3. Wait ~20 seconds
4. Kill the browser and shut down the service

I'm wondering if our web server or web server's sendRedirect() method isn't functioning the way you expect???  The webserver.log in the attachment shows the redirect Location: still containing the reportName= parameter.

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #21 on: April 02, 2009, 12:20:24 AM »
Looks like this issue is actually caused by a bug in your web server. There was an endless loop of redirection if the request URL has a parameter.  And the reason it's happening is because your implementation of response.encodeURL() appends the entire query string instead of just appending JSESSIONID. Look at this code:

Code: [Select]
   TraceMgr.trace(this, "*** submitURL = " + submitURL + ", encoded = " + response.encodeURL(submitURL));

And what it produced in the log file:

Code: [Select]
2009/04/02 00:16:37:459 : WebServerNoTrack - WebServerService - Thread-252 : [com.creamtec.ajaxswing.ServletHelper] *** submitURL = http://localhost:5080/VLTrader-VL0741-XL4210, encoded = http://localhost:5080/VLTrader-VL0741-XL4210?appParams=alex&jSessionId=bkenkmnp918ic

I was expecting to see encoded URL like this:

Code: [Select]
http://localhost:5080/VLTrader-VL0741-XL4210, encoded = http://localhost:5080/VLTrader-VL0741-XL4210?jSessionId=bkenkmnp918ic
 Is that correct?


kdiamond

  • Customer
  • Jr. Member
  • *
  • Posts: 53
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #22 on: April 02, 2009, 03:02:14 PM »
I am working on this issue for Andy, so he asked me to reply.

We changed our web server's response.encodeURL() method to append only the sessionID as you suggested.   

Here are the results, along with the debug files.

Steps:

1.  Brought up VLportal...displays home page in the usual manner.
2.  Selected Manual File Transfer...brings up embedded VLportal menu, displaying home page.
3.  Selected Manual File Transfer within embedded VLportal menu...brings up another embedded VLportal, displaying home page.
4.  Selected File Transfer History within embedded, embedded VLportal menu...brings up another embedded VLportal, displaying home page.
5.  Killed browser and then service.

Thank you.

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #23 on: April 02, 2009, 06:01:38 PM »
I don't think you've quite fixed it. Looking at the log I see:

Redirecting via browser to http://localhost:3080/VLPortal?1gxp4erxjj93n

Instead of what I'd expect to see:

Redirecting via browser to http://localhost:3080/VLPortal?jSessionId=1gxp4erxjj93n

Can you double check your encodeURL implementation? Maybe add some logging?
Also, if the browser stores cookies you don't even need to append jSessionId URL parameter.

And it would be great if you can try this on Tomcat or another web server to determine for sure if it's your web server or AjaxSwing.

Also, from your description, is the problem that the execution of menu commands does not change the appearance of the VLPortal?

Another inexplicable thing in the log is this segment:

2009/04/02 13:26:39:045 : WebServerNoTrack - WebServerService - Thread-266 : [com.creamtec.ajaxswing.ServletHelper] Redirecting via browser to http://localhost:3080/VLPortal?1gxp4erxjj93n
2009/04/02 13:26:39:045 : WebServerNoTrack - WebServerService - Thread-266 :
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.AjaxSwingRouter] doPost, path = null, characterEncoding = null
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.ServletHelper] parseAppNameAndAction, servletPath = /VLPortal
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.ServletHelper] getAppDesc for app name = vlportal
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.ServletHelper] getClientAgent for session com.cleo.webserver.WebServerSession@6b51d8, session id = 30949756
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.ServletHelper] Found existing agent
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.ServletHelper]  param = CLEO.userName, value = kdiamond
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.ServletHelper]  param = CLEO.sessionId, value = 1gxp4erxjj93n
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.ServletHelper]  param = reportName, value = ManualFileTransfer
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.ServletHelper] Invalid form submitted, no request id is found. Refreshing the page
2009/04/02 13:26:40:685 : WebServerNoTrack - WebServerService - Thread-270 : [com.creamtec.ajaxswing.ServletHelper] Request query string = reportName=ManualFileTransfer


You can see that AjaxSwing sends a redirect to http://localhost:3080/VLPortal?1gxp4erxjj93n
But the next request coming from the browser still contains query parameter reportName, which really shouldn't happen. Can this be some caching in your web server?

aevett

  • Customer
  • Sr. Member
  • *
  • Posts: 482
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #24 on: April 03, 2009, 09:29:14 AM »
We'll look to make sure we've fixed encodeURL correctly.

But I think there's a fundamental problem with the redirection idea, at least in the context of our web portal application.  The same resource path is used for both the main freemarker page and the ajaxswing frame.  The way that our servlet knows to send the request to freemarker or ajaxswing is by whether the resourcename parameter is present or not.  When the resourcename parameter gets stripped in the redirect, then our code sends the request to freemarker rather than ajaxswing.

In your debug snippet below, I think what is happening is that the redirect goes to freemarker so there's no ajaxswing debug again until the manual file transfer report is picked again in the browser.

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #25 on: April 03, 2009, 02:54:19 PM »
I agree, it looks like there is a design issue. But it seems to me that the redirect in itself is not the problem. You guys were the ones who pointed out that you want the URL query parameters removed on subsequent requests, and we've implemented it because it makes sense.

If I don't misunderstand your explanation, it seems that you should not use the presence of "reportName" parameter to determine if the request should go to AjaxSwing or FreeMarker. Why not map FreeMarker servlet to *.html, as we have done in the portal sample app that we've built for you? Then you'll know that URL http://localhost:3080/VLPortal is always for AjaxSwing, with or without parameters. URLs such as http://localhost:3080/welcome.html will go to FreeMarker.

Can you maybe use a different context mapping, e.g.:

AjaxSwing:  http://localhost:3080/VLPortal
FreeMarker: http://localhost:3080/VLPortal/html

BTW, is encoded URL below even valid?

http://localhost:3080/VLPortal?1gxp4erxjj93n

Let us know if you want to talk this over the phone.

aevett

  • Customer
  • Sr. Member
  • *
  • Posts: 482
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #26 on: April 03, 2009, 03:59:13 PM »
As you suggest, we'll try different ways to direct requests to AjaxSwing and FreeMarker.  We don't want the initial request to require .html, so we may also need to look for lack of a session ID as well.

We did have another bug in encodeURL(), but we've corrected that now.

We really do not want to have a different resource path for AjaxSwing versus FreeMarker, so we think the best option for us is using the extension.  We'll let you know...

kdiamond

  • Customer
  • Jr. Member
  • *
  • Posts: 53
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #27 on: April 03, 2009, 05:38:03 PM »
We have now fixed the encodeURL() method, and we have implemented your suggestion to map *.html to FreeMarker and let everything else go through AjaxSwing.  We are happy to say that all things seem to be operating properly now.  Sorry...we should have noticed this earlier.

Thank you for all your help with this issue.

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #28 on: April 03, 2009, 05:50:59 PM »
That's a happy Friday ending. Have a nice weekend:-)

kdiamond

  • Customer
  • Jr. Member
  • *
  • Posts: 53
    • View Profile
Re: Problem with router.updateInterval not occurring
« Reply #29 on: April 06, 2009, 12:47:16 PM »
We seem to be having a new strange problem -- one that we did not observe when we last reported to you.  Do you know why we would receive a GET request formatted as follows?

<<<<<< Request from Socket[addr=/127.0.0.1,port=1551,localport=3080] <<<<<<
GET /%22http:////localhost:3080//web_docs//images//ajaxswing//close.gif/%22 HTTP/1.1

The following format is what we'd expect:

<<<<<< Request from Socket[addr=/127.0.0.1,port=3687,localport=1080] <<<<<<
GET /web_docs/images/ajaxswing/close.gif HTTP/1.1

Please let us know your thoughts.  Also, attached is the complete debug file if you need it.

Thank you.