Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet freezes after displaying pages using showDocument

 
Elie Hirschman
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an applet which has clickable areas that redirect to jsps, and the user can then click back to the applet page. The code is done in the applet using the getAppletContext().showDocument(URL) method.
However, I have noticed after a recent build, that when I click on the link to visit page X, upon returning to the applet page, it is 9 times out of 10 FREEZING up and not responding.
I have set timeouts on the connect and read, to no avail. I see from the logging output that the applet stops responding at this line:


The url it is contacting is a servlet, from which it should've been receiving a Vector object.
The Servlet has the proper code in place for closing outputstreams, but for some reason the applet cannot connect to it after that call to showDocument().
Is there something I am missing here?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the server responding in time? Meaning, can you see in the server logs that it returns something to the applet?
 
Elie Hirschman
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Is the server responding in time? Meaning, can you see in the server logs that it returns something to the applet?

The logs show timely (immediate) access and response in the servlet calls prior to visiting page X, but after returning to the applet page, the server is NOT being hit - I have this set up in my IDE and I will see breakpoints in the servlet code being hit in the initial visits to the applet page, but not after visiting page X.
 
Elie Hirschman
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a work-around which I will use (for now) - I am using the showDocument() call not to navigate to another page, but to fire a javascript popup modal window, as so:

line from the Java applet:


this calls the Javascript function on the jsp:


...where showModal is a proprietary function to launch a new modal window with the provided url and window dimensions.

Still wondering why I was experiencing such a problem, though.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java versions 6.0.10 and earlier had a known problem when handing off from one applet to another. It drove CPU utilization up to 100%.

Some people claimed problems with 6.0.10 as well, but for me the problem magically disappeared at that point.
 
Elie Hirschman
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:Java versions 6.0.10 and earlier had a known problem when handing off from one applet to another. It drove CPU utilization up to 100%.

Some people claimed problems with 6.0.10 as well, but for me the problem magically disappeared at that point.


Some of my users are using JRE 1.6.0_6, but most are using 1.6.0_15-b03. I personally have the latest and greatest and was still having the issue.
The other thing is, Page X was just a simple JSP with NO applets on it. So it was an applet doing a showDocument on a page with no applets, and returning to a page WITH applets that was causing the locking - still not understanding why.


(BTW, I almost wrote "SITH applets" above... how cool would those applets be!!)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic