EVALUATION
The problem here is that the DNSNameService provider uses JNDI, and when creating a new Initial Context, JNDI tries to locate the jndi.properties file using the current threads context ClassLoader. If this ClassLoader (URLClassLoader in our case) has a URL whos host part is the same as the host being looked up then the hang will occur. I have attached a testcase that demonstrates this problem (B6314370.java).
|
|
|
EVALUATION
The fix is to avoid some of the JNDI framework by call through the NamingManager to get the DnsContext.
|
|
|
EVALUATION
I believe the hang is caused by the networking fix in mustang b49:
6206727: URLStreamHandler.equals wastes time
The following two testcase can be used to reproduce the problem:
http://nicole1.sfbay.sun.com:8080/JavawsMustangIntegTest/native/native_test.jnlp
http://nicole1.sfbay.sun.com:8080/JavawsMustangIntegTest/jar_download/jar_eager_1.jnlp
Execute the above jnlp application in b49 with hang java web start. (On windows only)
If you use b48, there is no hang.
There is no deployment integration in b49.
I also tried to replace URLStreamHandler.class from b48 into b49 rt.jar, hangs go away too.
Reassigning to networking team for further evaluation.
|
|
|
EVALUATION
this hang happens on the master b49 nightly build too, here is the thread dump when the hang occurs:
2005-08-22 16:00:40
Full thread dump Java HotSpot(TM) Client VM (1.6.0-ea-b49 mixed mode, sharing):
"javawsApplicationMain" prio=5 tid=0x02e32900 nid=0x4e0 in Object.wait() [0x0364e000..0x0364fc5c]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22ea2078> (a java.util.HashMap)
at java.lang.Object.wait(Unknown Source)
at java.net.InetAddress.checkLookupTable(Unknown Source)
- locked <0x22ea2078> (a java.util.HashMap)
at java.net.InetAddress.getAddressFromNameService(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at java.net.URLStreamHandler.getHostAddress(Unknown Source)
- locked <0x22e647e0> (a sun.net.www.protocol.http.Handler)
at java.net.URLStreamHandler.hashCode(Unknown Source)
at java.net.URL.hashCode(Unknown Source)
- locked <0x22e5c818> (a java.net.URL)
at java.util.HashMap.hash(Unknown Source)
at java.util.HashMap.containsKey(Unknown Source)
at sun.misc.URLClassPath.getLoader(Unknown Source)
- locked <0x22e08cf8> (a sun.misc.URLClassPath)
at sun.misc.URLClassPath.access$000(Unknown Source)
at sun.misc.URLClassPath$1.next(Unknown Source)
at sun.misc.URLClassPath$1.hasMoreElements(Unknown Source)
at java.net.URLClassLoader$3$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader$3.next(Unknown Source)
at java.net.URLClassLoader$3.hasMoreElements(Unknown Source)
at sun.misc.CompoundEnumeration.next(Unknown Source)
at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.getNextElement(Unknown Source)
at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.hasMore(Unknown Source)
at com.sun.naming.internal.ResourceManager.getApplicationResources(Unknown Source)
- locked <0x22ea1d70> (a java.util.WeakHashMap)
at com.sun.naming.internal.ResourceManager.getInitialEnvironment(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at javax.naming.directory.InitialDirContext.<init>(Unknown Source)
at sun.net.spi.nameservice.dns.DNSNameService$1.run(DNSNameService.java:107)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.spi.nameservice.dns.DNSNameService.getTemporaryContext(DNSNameService.java:103)
at sun.net.spi.nameservice.dns.DNSNameService.lookupAllHostAddr(DNSNameService.java:256)
at java.net.InetAddress.getAddressFromNameService(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at java.net.URLStreamHandler.getHostAddress(Unknown Source)
- locked <0x22e647e0> (a sun.net.www.protocol.http.Handler)
at java.net.URLStreamHandler.hashCode(Unknown Source)
at java.net.URL.hashCode(Unknown Source)
- locked <0x22e5c7e0> (a java.net.URL)
at java.util.HashMap.hash(Unknown Source)
at java.util.HashMap.containsKey(Unknown Source)
at sun.misc.URLClassPath.getLoader(Unknown Source)
- locked <0x22e08cf8> (a sun.misc.URLClassPath)
at sun.misc.URLClassPath.getResource(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
- locked <0x22df7a40> (a com.sun.jnlp.JNLPClassLoader)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
"Thread-3" daemon prio=5 tid=0x02e4c900 nid=0xe44 runnable [0x0368f000..0x0368fddc]
java.lang.Thread.State: RUNNABLE
at sun.net.dns.ResolverConfigurationImpl.notifyAddrChange0(Native Method)
at sun.net.dns.ResolverConfigurationImpl$AddressChangeListener.run(Unknown Source)
"AWT-EventQueue-0" prio=7 tid=0x02d9eb00 nid=0x1ec in Object.wait() [0x0360f000..0x0360fadc]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22dec808> (a java.awt.EventQueue)
at java.lang.Object.wait(Unknown Source)
at java.awt.EventQueue.getNextEvent(Unknown Source)
- locked <0x22dec808> (a java.awt.EventQueue)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
"TimerQueue" daemon prio=5 tid=0x02d83000 nid=0x4ec in Object.wait() [0x035cf000..0x035cfb5c]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22e628e8> (a javax.swing.TimerQueue)
at javax.swing.TimerQueue.run(Unknown Source)
- locked <0x22e628e8> (a javax.swing.TimerQueue)
at java.lang.Thread.run(Unknown Source)
"ConsoleWriterThread" daemon prio=5 tid=0x02d6ff00 nid=0x730 in Object.wait() [0x031ff000..0x031ffbdc]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22e46ef8> (a java.lang.Object)
at java.lang.Object.wait(Unknown Source)
at com.sun.deploy.util.ConsoleTraceListener$ConsoleWriterThread.run(Unknown Source)
- locked <0x22e46ef8> (a java.lang.Object)
"AWT-EventQueue-1" prio=7 tid=0x02d69500 nid=0xe5c runnable [0x031be000..0x031bfc5c]
java.lang.Thread.State: RUNNABLE
at com.sun.deploy.util.ConsoleHelper.dumpAllStacks(Native Method)
at com.sun.javaws.util.JavawsConsoleController14.dumpAllStacks(Unknown Source)
at com.sun.deploy.util.ConsoleWindow$2.actionPerformed(Unknown Source)
at javax.swing.JComponent$ActionStandin.actionPerformed(Unknown Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.KeyboardManager.fireBinding(Unknown Source)
at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.sun.deploy.ui.DialogTemplate$10.run(Unknown Source)
at com.sun.deploy.ui.DialogTemplate.setVisible(Unknown Source)
at com.sun.deploy.ui.UIFactory$10.execute(Unknown Source)
at com.sun.javaws.ui.JavawsSysRun.delegate(Unknown Source)
at com.sun.deploy.util.DeploySysRun.execute(Unknown Source)
at com.sun.deploy.util.DeploySysRun$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.util.DeploySysRun.executePrivileged(Unknown Source)
at com.sun.deploy.ui.UIFactory.showProgressDialog(Unknown Source)
at com.sun.javaws.ui.DownloadWindow$7.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
"Java2D Disposer" daemon prio=10 tid=0x02d56f00 nid=0xe9c in Object.wait() [0x0314f000..0x0314fcdc]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22e47000> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x22e47000> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at sun.java2d.Disposer.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
"traceMsgQueueThread" daemon prio=5 tid=0x02cd1e00 nid=0x7a4 in Object.wait() [0x0305f000..0x0305fa5c]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22df6f78> (a java.util.ArrayList)
at java.lang.Object.wait(Unknown Source)
at com.sun.deploy.util.Trace$TraceMsgQueueChecker.run(Unknown Source)
- locked <0x22df6f78> (a java.util.ArrayList)
at java.lang.Thread.run(Unknown Source)
"DestroyJavaVM" prio=5 tid=0x00358e00 nid=0xde4 waiting on condition [0x00000000..0x0006fb14]
java.lang.Thread.State: RUNNABLE
"AWT-Windows" daemon prio=7 tid=0x02a9ee00 nid=0x330 runnable [0x02f8f000..0x02f8fb5c]
java.lang.Thread.State: RUNNABLE
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
"AWT-Shutdown" prio=5 tid=0x02a9e900 nid=0x8ac in Object.wait() [0x02f4f000..0x02f4fbdc]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22df5b90> (a java.lang.Object)
at java.lang.Object.wait(Unknown Source)
at sun.awt.AWTAutoShutdown.run(Unknown Source)
- locked <0x22df5b90> (a java.lang.Object)
at java.lang.Thread.run(Unknown Source)
"Low Memory Detector" daemon prio=5 tid=0x02a6cd00 nid=0x764 runnable [0x00000000..0x00000000]
java.lang.Thread.State: RUNNABLE
"CompilerThread0" daemon prio=10 tid=0x02a6a800 nid=0xf0 waiting on condition [0x00000000..0x02c1fa38]
java.lang.Thread.State: RUNNABLE
"Attach Listener" daemon prio=10 tid=0x02a69900 nid=0x96c runnable [0x00000000..0x00000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=10 tid=0x02a68d00 nid=0xdb4 runnable [0x00000000..0x00000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=9 tid=0x02a2db00 nid=0xeb8 in Object.wait() [0x02b5f000..0x02b5fadc]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22df5dc0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x22df5dc0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
"Reference Handler" daemon prio=10 tid=0x02a2c600 nid=0x838 in Object.wait() [0x02b1f000..0x02b1fb5c]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22df5958> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Unknown Source)
at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
- locked <0x22df5958> (a java.lang.ref.Reference$Lock)
"VM Thread" prio=10 tid=0x02a2b600 nid=0xd34 runnable
"VM Periodic Task Thread" prio=10 tid=0x02a6e000 nid=0x4e8 waiting on condition
enceHandler.run(Unknown Source)
- locked <0x22df5958> (a java.lang.ref.Reference$Lock)
"VM Thread" prio=10 tid=0x02a2b600 nid=0xd34 runnable
"VM Periodic Task Thread" prio=10 tid=0x02a6e000 nid=0x4e8 waiting on condition
----------------------------------------------------
Done.
|
|
|