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

JWS installation loops on Windows NT

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.0.1
    • deploy
    • x86
    • windows_nt



      Name: nt126004 Date: 11/09/2001


      C:\Program Files\JavaSoft\JRE\1.3.1_01\bin>.\java -version
      java version "1.3.1_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
      Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

      I have an application which requires JSSE. As deploying JSSE as a simple set of
      signed JAR files doesn't seem to work, I have created an installation program
      that downloads jnet.jar, jsse.jar and jcert.jar into the lib\ext directory of
      the runtime.
      I have tested under Windows 95, Windows 98, Windows 2000 and it works fine each
      time. Under Windows NT it worked on a workstation but on another, the
      installation loops.
      The failing machine was set to "Workgroup" instead of Domain.
      If it is part of our NT Domain, it works, if it's set to "Workgroup"
      the installation loops.

      Here are the two JNLPs:

      /**** myapp.jnlp ***/
      <jnlp
        spec="1.0+"
        codebase="http://myserver.com/myapp"
        href="jnlp/myapp.jnlp">
        <information>
          <title>InstaPay</title>
          <vendor>My Company</vendor>
          <homepage href="http://myapp.com/"/>
          <description>My Application</description>
        </information>
        <security>
            <all-permissions/>
        </security>
        <resources>
          <j2se href="http://java.sun.com/products/autodl/j2se" version="1.3.1_01"/>
          <jar href="jnlp/jar/myjar.jar" download="eager"/>
          <jar href="jnlp/jar/jh.jar" download="eager"/>
          <nativelib href="jnlp/jar/mynative.jar" download="eager"/>
          <extension href="jnlp/jsse.jnlp"/>
          <property name="idebug" value="true"/>
        </resources>
        <application-desc main-class="com.mycompany.mainclass" /> (tried without
      main-class same effect)
      </jnlp>

      /** jsse.jnlp ***/
      <jnlp
        spec="1.0+"
        codebase="http://myserver.com/myapp"
        href="jnlp/jsse.jnlp">
        <information>
          <title>Java Secure Socket Environment</title>
          <vendor>Sun Microsystems, Inc.</vendor>
        </information>
        <security>
         <all-permissions/>
        </security>
        <resources>
          <j2se version="1.3*"/>
          <jar href="jnlp/installer/jsse_i.jar" download="eager"/>
        </resources>
        <installer-desc/>
      </jnlp>

      1/ JWS downloads the first three jar files (myapp.jar, mynative.jar and jh.jar)
      to the cache.
      2/ JWS launches the JSSE installation after displaying the Grant dialog box. It
      ends successfully (can see the message and the JSSE JAR files are indeed in the
      ext directory).
      3/ The console window popping up and goes away immediatly and JWS installation
      window comes back. It's resuming the installation of the application, but it
      skips the first part as it was already downloaded.
      4/ It relaunch the JSSE installation which still ends successfully and back to
      step 3 over and over.

      Here is the log from the server (Apache 1.3.19):
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:01:53 -0800] "GET /myapp/jnlp/myapp.jnlp
      HTTP/1.1" 304 -
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -0800] "HEAD /myapp/jnlp/myapp.jnlp
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -0800] "GET /myapp/jnlp/myapp.jnlp
      HTTP/1.1" 200 950
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -
      0800] "HEAD /myapp/images/swingset2.jpg HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -0800] "HEAD /myapp/jnlp/myapp.jnlp
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -0800] "GET /myapp/jnlp/jsse.jnlp
      HTTP/1.1" 200 446
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -
      0800] "HEAD /myapp/jnlp/jar/myjar.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -
      0800] "HEAD /myapp/images/swingset2.jpg HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -0800] "HEAD /myapp/jnlp/jar/jh.jar
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -
      0800] "HEAD /myapp/jnlp/jar/mynative.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:00 -
      0800] "HEAD /myapp/jnlp/installer/jsse_i.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:01 -0800] "GET /myapp/jnlp/jar/myjar.jar
      HTTP/1.1" 200 2017811
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:13 -0800] "GET /myapp/jnlp/jar/jh.jar
      HTTP/1.1" 200 347212
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:15 -
      0800] "GET /myapp/jnlp/jar/mynative.jar HTTP/1.1" 200 52913
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:16 -
      0800] "GET /myapp/jnlp/installer/jsse_i.jar HTTP/1.1" 200 4025
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:26 -0800] "HEAD /myapp/jnlp/jsse.jnlp
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:26 -0800] "GET /myapp/jnlp/jsse.jnlp
      HTTP/1.1" 200 446
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:26 -0800] "HEAD /myapp/jnlp/jsse.jnlp
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:26 -
      0800] "HEAD /myapp/jnlp/installer/jsse_i.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:26 -0800] "HEAD /myapp/jnlp/jsse.jnlp
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:26 -
      0800] "HEAD /myapp/jnlp/installer/jsse_i.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:37 -0800] "HEAD /myapp/jnlp/myapp.jnlp
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:37 -
      0800] "HEAD /myapp/images/swingset2.jpg HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:37 -
      0800] "HEAD /myapp/jnlp/jar/myjar.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:38 -0800] "HEAD /myapp/jnlp/jar/jh.jar
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:38 -
      0800] "HEAD /myapp/jnlp/jar/mynative.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:39 -0800] "HEAD /myapp/jnlp/myapp.jnlp
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:39 -0800] "GET /myapp/jnlp/jsse.jnlp
      HTTP/1.1" 200 446
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:39 -
      0800] "HEAD /myapp/jnlp/jar/myjar.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:39 -0800] "HEAD /myapp/jnlp/jar/jh.jar
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:39 -
      0800] "HEAD /myapp/jnlp/jar/mynative.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:46 -0800] "HEAD /myapp/jnlp/jsse.jnlp
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:46 -
      0800] "HEAD /myapp/jnlp/installer/jsse_i.jar HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:47 -0800] "HEAD /myapp/jnlp/jsse.jnlp
      HTTP/1.1" 200 0
      xxx.xxx.xxx.xxx - - [02/Nov/2001:17:02:47 -
      0800] "HEAD /myapp/jnlp/installer/jsse_i.jar HTTP/1.1" 200 0

      The platform is Windows NT Service Pack 6.
      JWS uses 1.3.0_03 (but I've tried with 1.3.1 with the same result), my
      application uses 1.3.1_01.


      As for the installation program, here it is:

      import java.io.*;
      import java.net.*;
      import java.util.*;
      import java.util.jar.*;
      import java.util.zip.*;
      import javax.jnlp.*;

      public class JARJWSInstaller {
        ExtensionInstallerService clientJWS;
        String[] jarsToDownload = null;
        String codeBase;

        public JARJWSInstaller() {}

        /**
         * install
         */
        public void install() {
         try {
          clientJWS =
      (ExtensionInstallerService)ServiceManager.lookup("javax.jnlp.ExtensionInstal
      lerService");
         } catch (UnavailableServiceException e) {
          return;
         }

         // What to install
         clientJWS.setHeading("Determining files to install...");
         URL _url = clientJWS.getExtensionLocation();
         jarsToDownload = new String[3];
         jarsToDownload[0] = "jsse.jar";
         jarsToDownload[1] = "jcert.jar";
         jarsToDownload[2] = "jnet.jar";

         if (jarsToDownload == null) {
          clientJWS.installFailed();
          return;
         }

         // Where to install to
         clientJWS.setHeading("Determining installation location...");
         String javahome = System.getProperty("java.home");
         codeBase = "/myapp/jnlp/jar/";

         // Make the ext directory if not exist - 1.3.0 bug
         File dirF = new File(javahome + fs + "lib" + fs + "ext");
         if (!dirF.exists())
          dirF.mkdir();

         for (int i=0; i<jarsToDownload.length; i++) {
           clientJWS.setHeading("Checking " + jarsToDownload[i] + "...");
           BufferedInputStream bis = null;
           BufferedOutputStream bos = null;
           try {
            String fs = System.getProperty("file.separator");
            String fileName = javahome + fs + "lib" + fs + "ext" + fs +
      jarsToDownload[i];

            File ftoInstall = new File(fileName);
              // Install if not present
            if (!ftoInstall.exists()) {
              clientJWS.setHeading("Checking " + jarsToDownload[i] + "...");
              URL newurl = new URL(_url.getProtocol(), _url.getHost(), codeBase +
      jarsToDownload[i]);
              URLConnection con = newurl.openConnection();
              con.setDoOutput(false);
              con.setDoInput(true);
              con.setUseCaches(false);
              InputStream is = con.getInputStream();

              bis = new BufferedInputStream(is);
              FileOutputStream fos = new FileOutputStream(ftoInstall);
              int length = con.getContentLength();
              byte[] bts = new byte[1000];
              int nbread = 0;
              int totalRead = 0;
              while ((nbread = bis.read(bts)) > 0) {
                totalRead += nbread;
                fos.write(bts, 0, nbread);
              }
              is.close();
              bis.close();
              if (fos != null)
                  fos.close();
            }
          } catch (Exception e) {
            clientJWS.installFailed();
            return;
          }
         }
         clientJWS.setHeading("Installation succeeded");
      // This message appears
         clientJWS.installSucceeded(false);
        }

        /**
         * main method
         */
        public static void main(String[] args) {
          JARJWSInstaller jj = new JARJWSInstaller();
          jj.install();
          System.exit(0);
        }
      }
      (Review ID: 134950)
      ======================================================================

            ngthomas Thomas Ng (Inactive)
            nthompsosunw Nathanael Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: