Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6972847

New Socket hang on connection to another host with JNLP

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      There is a problem with hostname resolution for domain names.
      Applications started as JNLP and contains unsiged jar files.

      The user tries to connect to an external address and is asked to allow
      this connection. The socket connection should be opened and a hostname
      resolution is done by Java. For domain names of the www, the call takes
      about 30 seconds before the application can connect.

      If the same application run local (not Java Webstart) ) on the same hardware
      and there is no hanging.
      Also if the address is a LAN address then there
      is no hanging.

      How can prevent this timeout?

      Configuration:
      ==============
      Java Web Start 1.6.0_20
      JRE-Version 1.6.0_20-b02 Java HotSpot(TM) Server VM
      OS: Window XP and Ubuntu

      Steps to reproduce:
      ===================
      Test program has been attached. codebase need to be changed in the jnlp file.
      If start the jnlp file then it will need 20 seconds. If start the batch file
      then it only need 25 milliseocnds.

      Hints to help:
      ==============
      The domain in the test case does not have a revers lockup.
      If you use a domain with a reverse lookup then it is faster.


      Below you will find the stacktrace where the applications hangs. The
      packages org.apache.commons.httpclient and org.apache.webdav.lib are
      located in unsigned jar files.

          java.lang.Thread.State: RUNNABLE
           at java.net.Inet6AddressImpl.getHostByAddr(Native Method)
           at java.net.InetAddress$1.getHostByAddr(InetAddress.java:854)
           at java.net.InetAddress.getHostFromNameService(InetAddress.java:534)
           at java.net.InetAddress.getHostName(InetAddress.java:477)
           at java.net.SocketPermission.getCanonName(SocketPermission.java:633)
           at
      java.net.SocketPermission.impliesIgnoreMask(SocketPermission.java:956)
           at
      java.net.SocketPermissionCollection.implies(SocketPermission.java:1317)
           - locked <0xa4b8aaa0> (a java.net.SocketPermissionCollection)
           at java.security.Permissions.implies(Permissions.java:166)
           - locked <0xa4b8a9f8> (a java.security.Permissions)
           at sun.security.provider.PolicyFile.implies(PolicyFile.java:1126)
           at java.security.ProtectionDomain.implies(ProtectionDomain.java:224)
           at
      java.security.AccessControlContext.checkPermission(AccessControlContext.java:301)
           at
      java.security.AccessController.checkPermission(AccessController.java:546)
           at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
           at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
           at
      com.sun.javaws.security.JavaWebStartSecurity.checkConnect(JavaWebStartSecurity.java:117)
           at java.net.InetAddress.getAllByName0(InetAddress.java:1146)
           at java.net.InetAddress.getAllByName(InetAddress.java:1084)
           at java.net.InetAddress.getAllByName(InetAddress.java:1020)
           at java.net.InetAddress.getByName(InetAddress.java:970)
           at com.sun.jnlp.ApiDialog.askConnect(ApiDialog.java:86)
           at
      com.sun.javaws.security.JavaWebStartSecurity.checkConnect(JavaWebStartSecurity.java:132)
           at java.net.InetAddress.getAllByName0(InetAddress.java:1146)
           at java.net.InetAddress.getAllByName(InetAddress.java:1084)
           at java.net.InetAddress.getAllByName(InetAddress.java:1020)
           at java.net.InetAddress.getByName(InetAddress.java:970)
           at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
           at java.net.Socket.<init>(Socket.java:249)
           at
      org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)
           at
      org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:121)
           at
      org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
           at
      org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
           at
      org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
           at
      org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
           at
      org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
           at
      org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3526)
           at
      org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3491)
           at
      org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java:976)
           at
      org.apache.webdav.lib.WebdavResource.setBasicProperties(WebdavResource.java:921)
           at
      org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:1925)
           at
      org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:1948)
           at com.inet.report.repository.davclient.a.<init>(SourceFile:34)
           at
      com.inet.report.repository.davclient.WebDavConnector.getRootFolder(SourceFile:210)
           at com.inet.designer.e.d.call(SourceFile:269)
           at
      com.inet.lib.swing.progress.ProgressRunner$2$1.doInBackground(SourceFile:128)
           at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                herrick Andy Herrick
                Reporter:
                tyao Ting-Yun Ingrid Yao (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: