JDK-4429816 : JWS 1.0.1 Seems to be hang waiting for remote application (Merlin B57)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.0.1,1.4.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_98,windows_2000
  • CPU: x86
  • Submitted: 2001-03-24
  • Updated: 2001-06-26
  • Resolved: 2001-05-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 beta2Fixed
Related Reports
Duplicate :  
Relates :  
Description
This might be GUI problem but I am not quite sure. JWS is hanging for long
time to get remote informations.

Step to reproduce (On Windows):
- Install Merlin B57.
- After installation, remove Java Web Start from control panel. (this is
  due to another bug.)
- Get one unbundled copy from:
  /usr/local/java/javaws1.0.1/bundles/javaws-1_0_1-win-us.exe
-Install it to a dir w/o ' ', say C:\JWS101
- Start JWS, after star JWS, click File -> preference immediately.

Now you have two window, main application manager is trying through our
proxy site to get demo application from java.sun.com. You can see it
get the first application Draw, but after that, JWS is hanging for
long time. Try to move/overlap the windows, you will see GUI is freezing.

After a long time, GUI will come back.


yu.wang@eng 2001-03-23

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta2 FIXED IN: merlin-beta2 INTEGRATED IN: merlin-beta2 VERIFIED IN: merlin-beta2
14-06-2004

WORK AROUND Set the security property: networkaddress.cache.negative.ttl to -1, or to a positive value such as 10. This applies to merlin builds from b58 onwards.
11-06-2004

EVALUATION to start JWS, the program has no hang any more. yu.wang@eng 2001-04-03 The problem is caused by the behavior of the resolver on Windows. By default, name lookups are done using the local hosts file, DNS, and finally WINS (in that sequence). The problem is with WINS where lookups (that fail) appear to be rather slow. If multiple WINS servers are configured then each one is tried in sequence. Even if no WINS server is configured, the fallback is to broadcast on the local subnet (three times). WINS can be switched off on Win2000 but apparently not on NT. This problem was masked on 1.3 because of (unintended) caching of the negative results. See work-around. Will fix for merlin beta refresh. michael.mcmahon@ireland 2001-04-05 ----------------------------------------------------------- Default caching policy for negative lookups is set to 10 seconds in java.security properties file. This seems like a reasonable compromise between not repeating lookups that are likely to fail, and getting timely access to changed state. michael.mcmahon@ireland 2001-05-30
30-05-2001

EVALUATION I don't know yet why this is happening with recent 1.4 builds and not with 1.3, but the following information may be useful. The hang occurs because the proxy server just stops sending data on the particular TCP connection. This appears to happen because JWS is not closing some URLConnections, leaving the sockets open with data unread. In particular, the connections that are opened for determining file lengths are not being closed right now. If you add the following line to DownloadProtocol.DownloadSizeAction.actionDownload ... uc.getInputStream().close() then the problem does not seem to happen. I noticed also that some proxies exhibit the problem eg. webcache.corp which runs squid 2.2, but other proxies such as webcache.uk do not show the problem. michael.mcmahon@ireland 2001-03-28 ------------------------------------------ The specific suggestion, adding uc.getInputStream().close(); to DownloadProtocol.DownloadSizeAction.actionDownload() does not fix the problem. I am running merlin b58 with javaws 1.0.1 - FCS-12 on windows NT. adding this line seems to have no effect. Many programs freeze or hang, sometimes before putting up window, and sometimes after putting up window but before refreshing (bugs 4429816, and 4429811) andy.herrick@East 2001-03-31 ---------------------------- The hanging which I see now, after the modification I suggested looks the same as what is reported in 4429811. A stack trace shows that no thread is in the networking code, and it looks more like an AWT or Swing issue. However, if the hang in this report is different, then I need more information to be able to reproduce it. In particular: - does it happen on Solaris? - which web proxy is being used? - can you get a stack trace at the time when it hangs? michael.mcmahon@ireland 2001-04-02 ---------------------------------------------- - Also happen on Solaris - webcache-cup.eng.sun.com:8080 (This doesn't matter, I change it to other proxy servers and it also happens.) The following is a thread dump on Windows 2000: yu.wang@eng 2001-04-02 I looked at the stack trace that Nathan generated, and felt very intrigued by the several threads that are calling InetAddress.getAddressFromNameService. Since the host in the URLs in this tests (I was told) are hosts that are outside of the firewall, the http.proxyHost and http.proxyPort properties should be set, all the connections should be done through the proxy server. We shouldn't try to resolve the hosts' IP addresses because that information is usually not available inside the firewall. It looks as though we are doing it anyway inside HttpClient. If we are trying to resolve the hostnames, that could explain why there seem to be a hanging and later recovery. The name service couldn't resolve the IP addresses and eventually timed out. yingxian.wang@eng 2001-04-02 Re-Generated thread dump w/ source line info per yingxian's request: Full thread dump: "Keep-Alive-Timer:java.sun.com" daemon prio=9 tid=0x08B458E8 nid=0x234 waiting on monitor [bc9f000..bc9fdbc] at java.lang.Thread.sleep(Native Method) at sun.net.www.http.ClientVector.run(KeepAliveCache.java:219) at java.lang.Thread.run(../../../src/share/classes/java/lang/Thread.java:579) "Thread-13" prio=7 tid=0x08BAFDA8 nid=0x38c runnable [bc5f000..bc5fdbc] at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:591) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:819) at java.net.InetAddress.getAllByName0(InetAddress.java:775) at java.net.InetAddress.getAllByName0(InetAddress.java:748) at java.net.InetAddress.getAllByName(InetAddress.java:742) at java.net.InetAddress.getByName(InetAddress.java:679) at sun.net.www.http.HttpClient.<init>(HttpClient.java:270) at sun.net.www.http.HttpClient.<init>(HttpClient.java:290) at sun.net.www.http.HttpClient.New(HttpClient.java:302) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:367) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:460) - locked <02A70170> (a sun.net.www.protocol.http.HttpURLConnection) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:235) at com.sun.javaws.util.URLUtil.doesURLExist(Unknown Source) at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source) at com.sun.javaws.cache.DownloadProtocol.isLaunchFileUpdateAvailable(Unknown Source) at com.sun.javaws.LaunchDownload.isUpdateAvailable(Unknown Source) at com.sun.javaws.ui.player.Player$IndicatorsPanel$LazyUpdateCheck.run(Unknown Source) "Thread-12" prio=7 tid=0x08A98B30 nid=0x3e8 waiting on monitor [bc1f000..bc1fdbc] at java.lang.Object.wait(Native Method) - waiting on <02D2FF70> (a java.util.HashMap) at java.lang.Object.wait(../../../src/share/classes/java/lang/Object.java:425) at java.net.InetAddress.checkLookupTable(InetAddress.java:868) - locked <02D2FF70> (a java.util.HashMap) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:808) at java.net.InetAddress.getAllByName0(InetAddress.java:775) at java.net.InetAddress.getAllByName0(InetAddress.java:748) at java.net.InetAddress.getAllByName(InetAddress.java:742) at java.net.InetAddress.getByName(InetAddress.java:679) at sun.net.www.http.HttpClient.<init>(HttpClient.java:270) at sun.net.www.http.HttpClient.<init>(HttpClient.java:290) at sun.net.www.http.HttpClient.New(HttpClient.java:302) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:367) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:460) - locked <029F0F38> (a sun.net.www.protocol.http.HttpURLConnection) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:235) at com.sun.javaws.util.URLUtil.doesURLExist(Unknown Source) at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source) at com.sun.javaws.cache.DownloadProtocol.getResource(Unknown Source) at com.sun.javaws.cache.CacheImageLoader$DelayedImageLoader.handleLoadImage(Unknown Source) at com.sun.javaws.cache.CacheImageLoader$ImageLoader.run(Unknown Source) at java.lang.Thread.run(../../../src/share/classes/java/lang/Thread.java:579) "Keep-Alive-Timer:java.sun.com" daemon prio=9 tid=0x08B4DE98 nid=0x380 waiting on monitor [bb9f000..bb9fdbc] at java.lang.Thread.sleep(Native Method) at sun.net.www.http.ClientVector.run(KeepAliveCache.java:219) at java.lang.Thread.run(../../../src/share/classes/java/lang/Thread.java:579) "Thread-3" prio=7 tid=0x08A998D0 nid=0x40c waiting on monitor [90af000..90afdbc] at java.lang.Thread.sleep(Native Method) at com.sun.javaws.ui.player.CacheEntryManager$CacheChecker.run(Unknown Source) at java.lang.Thread.run(../../../src/share/classes/java/lang/Thread.java:579) "TimerQueue" daemon prio=5 tid=0x00957610 nid=0x424 waiting on monitor [902f000..902fdbc] at java.lang.Object.wait(Native Method) - waiting on <02D01B98> (a javax.swing.TimerQueue) at javax.swing.TimerQueue.run(TimerQueue.java:234) - locked <02D01B98> (a javax.swing.TimerQueue) at java.lang.Thread.run(../../../src/share/classes/java/lang/Thread.java:579) "Thread-1" prio=5 tid=0x002347D8 nid=0x33c waiting on monitor [0..6fb30] "AWT-EventQueue-0" prio=7 tid=0x08AC8390 nid=0x390 waiting on monitor [8fcf000..8fcfdbc] at java.lang.Object.wait(Native Method) - waiting on <02D2FF70> (a java.util.HashMap) at java.lang.Object.wait(../../../src/share/classes/java/lang/Object.java:425) at java.net.InetAddress.checkLookupTable(InetAddress.java:868) - locked <02D2FF70> (a java.util.HashMap) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:808) at java.net.InetAddress.getAllByName0(InetAddress.java:775) at java.net.InetAddress.getAllByName0(InetAddress.java:748) at java.net.InetAddress.getAllByName(InetAddress.java:742) at java.net.InetAddress.getByName(InetAddress.java:679) at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:343) - locked <02C75558> (a sun.net.www.protocol.http.Handler) at java.net.URLStreamHandler.hostsEqual(URLStreamHandler.java:362) at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:309) at java.net.URLStreamHandler.equals(URLStreamHandler.java:245) at java.net.URL.equals(URL.java:752) at com.sun.javaws.ui.player.JNLEntry.equals(Unknown Source) at java.util.ArrayList.indexOf(../../../src/share/classes/java/util/ArrayList.java:208) at java.util.ArrayList.contains(../../../src/share/classes/java/util/ArrayList.java:189) at com.sun.javaws.ui.player.HTMLEntryManager$2.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154) at java.awt.EventQueue.dispatchEvent(EventQueue.java:437) at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:140) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:126) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:121) at java.awt.EventDispatchThread.run(EventDispatchThread.java:99) "AWT-Windows" daemon prio=7 tid=0x08AC6BF8 nid=0x408 runnable [8f8f000..8f8fdbc] at sun.awt.windows.WToolkit.eventLoop(Native Method) at sun.awt.windows.WToolkit.run(WToolkit.java:215) at java.lang.Thread.run(../../../src/share/classes/java/lang/Thread.java:579) "AWT-Shutdown" prio=5 tid=0x0093A458 nid=0x3fc waiting on monitor [8f4f000..8f4fdbc] at java.lang.Object.wait(Native Method) - waiting on <02C8A5F8> (a java.lang.Object) at java.lang.Object.wait(../../../src/share/classes/java/lang/Object.java:425) at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:262) - locked <02C8A5F8> (a java.lang.Object) at java.lang.Thread.run(../../../src/share/classes/java/lang/Thread.java:579) "Signal Dispatcher" daemon prio=10 tid=0x0023DDE8 nid=0x350 waiting on monitor [0..0] "Finalizer" daemon prio=9 tid=0x08A40B38 nid=0x1f0 waiting on monitor [8cff000..8cffdbc] at java.lang.Object.wait(Native Method) - waiting on <02C75228> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(../../../src/share/classes/java/lang/ref/ReferenceQueue.java:111) - locked <02C75228> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(../../../src/share/classes/java/lang/ref/ReferenceQueue.java:126) at java.lang.ref.Finalizer$FinalizerThread.run(../../../src/share/classes/java/lang/ref/Finalizer.java:162) "Reference Handler" daemon prio=10 tid=0x08A40048 nid=0x364 waiting on monitor [8cbf000..8cbfdbc] at java.lang.Object.wait(Native Method) - waiting on <02C75288> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(../../../src/share/classes/java/lang/Object.java:425) at java.lang.ref.Reference$ReferenceHandler.run(../../../src/share/classes/java/lang/ref/Reference.java:110) - locked <02C75288> (a java.lang.ref.Reference$Lock) "VM Thread" prio=5 tid=0x0093F1C0 nid=0x400 runnable "VM Periodic Task Thread" prio=10 tid=0x0023CB88 nid=0x3f0 waiting on monitor "Suspend Checker Thread" prio=10 tid=0x0023D498 nid=0x214 runnable yu.wang@eng 2001-04-02 -------------------------------------------------- The stack trace shows the following. In HttpClient we are doing a DNS lookup of java.sun.com (or whatever the name is -- outside the firewall). Most internal DNS servers cannot resolve external names and these queries are returning an error. In 1.3 we used to cache negative responses like this, so this would explain why it works fine with 1.3. However, it is not correct to cache negative responses and we cannot change that behavior. I checked the number of DNS queries from starting the JWS control panel to launching an application and there were 9 requests, all of which fail. Obviously, if the DNS server is slow to respond then the delay is multiplied by the number of queries. I already suggested a way to test this theory (setting the networkaddress.cache.negative.ttl security property to -1) This will work with merlin b58. Another way to test with any previous build is to set the DNS server on the PC to be 129.150.254.2. This server can resolve external addresses and if the hang is eliminated then I think we know for sure this is the problem. Need to check if the DNS query at HttpClient:line 270 is really needed. michael.mcmahon@ireland 2001-04-03 ------------------------------------------------ As my mail talked with Michael, I couldn't do much changing my DNS server on my pc. All of our PCs use DHCP and the DNS server config is controlled by ServiceDesk. (I have to file a service ticket if I want to change, this will go through a horrible process.) Anyway, the following is the info on my pc: E:\>ipconfig /all Windows 2000 IP Configuration Host Name . . . . . . . . . . . . : windows2000 Primary DNS Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : eng.sun.com Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : eng.sun.com Description . . . . . . . . . . . : 3Com EtherLink XL 10/100 PCI For Complete PC Management NIC (3C905C-TX) Physical Address. . . . . . . . . : 00-01-02-41-1A-6B DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IP Address. . . . . . . . . . . . : 129.144.252.69 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 129.144.252.254 DHCP Server . . . . . . . . . . . : 129.144.7.20 DNS Servers . . . . . . . . . . . : 129.144.170.47 129.144.134.19 129.146.1.152 Primary WINS Server . . . . . . . : 129.144.174.80 Secondary WINS Server . . . . . . : 129.144.174.81 Lease Obtained. . . . . . . . . . : Monday, April 02, 2001 6:16:23 PM Lease Expires . . . . . . . . . . : Monday, January 18, 2038 7:14:07 PM[comanche:yuwang:tcsh:~] > Hope this helps. If you think it's possible (I don't know) to specify DNS server on command line, like a -Dsystem.property, we may try that. yu.wang@eng 2001-04-03 -Dsun.net.inetaddr.negative.ttl=-1 is working. using this way
03-04-2001