• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • deploy-plugin
    • None
    • Platform: All, OS: All

      I clicked on

      https://hudson.dev.java.net/hudson.jnlp

      and accepted the security certificate. I was greeted with a window containing:

      [Winstone 2008/09/04 13:45:29] - Beginning extraction from war file
      [Winstone 2008/09/04 13:45:29] - Container startup failed

      winstone.WinstoneException: The warfile supplied is unavailable or invalid
      (/home/jglick)
      at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:214)
      at winstone.HostConfiguration.<init>(HostConfiguration.java:73)
      at winstone.HostGroup.initHost(HostGroup.java:85)
      at winstone.HostGroup.<init>(HostGroup.java:45)
      at winstone.Launcher.<init>(Launcher.java:196)
      at winstone.Launcher.main(Launcher.java:391)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at Main.main(Main.java:69)
      at JNLPMain.main(JNLPMain.java:27)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.javaws.Launcher.executeApplication(Launcher.java:1293)
      at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1239)
      at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1086)
      at com.sun.javaws.Launcher.run(Launcher.java:105)
      at java.lang.Thread.run(Thread.java:619)

          [JENKINS-2326] JNLP "test drive" deployment of Hudson failed

          I just tried it on my Windows system but it worked as expected.
          Perhaps an earlier version was broken?

          Does it still not work for you?

          Kohsuke Kawaguchi added a comment - I just tried it on my Windows system but it worked as expected. Perhaps an earlier version was broken? Does it still not work for you?

          cleitner added a comment -

          On linux the JNLP doesn't work. Downloading the jar file specified in the jnlp
          and running java -cp hudson.jar JNLPMain works fine though.

          cleitner added a comment - On linux the JNLP doesn't work. Downloading the jar file specified in the jnlp and running java -cp hudson.jar JNLPMain works fine though.

          gradopado added a comment -

          I could not run the JNLP on my Mac (OSX 10.4). I've added a slash to the URL in
          the jnlp file <jar href="http://x.x.x.x:8080/jnlpJars/remoting.jar/"></jar> Then
          I could run it fine using javaws.

          Using "curl" or the Safari browser on the Mac the original URL without slash did
          not work either. With an added slash it worked fine.

          gradopado added a comment - I could not run the JNLP on my Mac (OSX 10.4). I've added a slash to the URL in the jnlp file <jar href="http://x.x.x.x:8080/jnlpJars/remoting.jar/"></jar> Then I could run it fine using javaws. Using "curl" or the Safari browser on the Mac the original URL without slash did not work either. With an added slash it worked fine.

          gradopado added a comment -

          > I could not run the JNLP on my Mac (OSX 10.4). I've added a slash to the URL
          > in the jnlp file <jar href="http://x.x.x.x:8080/jnlpJars/remoting.jar/">...

          Ooops, sorry! I experienced problems starting a JNLP-slave on a Mac, not when
          test driving!

          gradopado added a comment - > I could not run the JNLP on my Mac (OSX 10.4). I've added a slash to the URL > in the jnlp file <jar href="http://x.x.x.x:8080/jnlpJars/remoting.jar/">... Ooops, sorry! I experienced problems starting a JNLP-slave on a Mac, not when test driving!

          It fails for me too. Using Vista/jre1.6.0_07/Firefox

          winstone.WinstoneException: The warfile supplied is unavailable or invalid
          (C:\Users\redacted_user\Documents\Downloads)
          at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:214)
          at winstone.HostConfiguration.<init>(HostConfiguration.java:73)
          at winstone.HostGroup.initHost(HostGroup.java:85)
          at winstone.HostGroup.<init>(HostGroup.java:45)
          at winstone.Launcher.<init>(Launcher.java:196)
          at winstone.Launcher.main(Launcher.java:391)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at Main.main(Main.java:70)
          at JNLPMain.main(JNLPMain.java:27)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at com.sun.javaws.Launcher.executeApplication(Unknown Source)
          at com.sun.javaws.Launcher.executeMainClass(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)

          lukewpatterson added a comment - It fails for me too. Using Vista/jre1.6.0_07/Firefox winstone.WinstoneException: The warfile supplied is unavailable or invalid (C:\Users\redacted_user\Documents\Downloads) at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:214) at winstone.HostConfiguration.<init>(HostConfiguration.java:73) at winstone.HostGroup.initHost(HostGroup.java:85) at winstone.HostGroup.<init>(HostGroup.java:45) at winstone.Launcher.<init>(Launcher.java:196) at winstone.Launcher.main(Launcher.java:391) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at Main.main(Main.java:70) at JNLPMain.main(JNLPMain.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(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)

          Jesse Glick added a comment -

          Still broken for me. Looks bad because you are offered to "test drive" Hudson
          but then you cannot.

          Jesse Glick added a comment - Still broken for me. Looks bad because you are offered to "test drive" Hudson but then you cannot.

          Code changed in hudson
          User: : jglick
          Path:
          trunk/hudson/extras/executable-war/src/main/java/Main.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=15682
          Log:
          [FIXED JENKINS-2326] I once was lost but now I'm found.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : jglick Path: trunk/hudson/extras/executable-war/src/main/java/Main.java http://fisheye4.cenqua.com/changelog/hudson/?cs=15682 Log: [FIXED JENKINS-2326] I once was lost but now I'm found.

          Tried just now, getting:

          winstone.WinstoneException: The warfile supplied is unavailable or invalid
          (C:\Users\redactedUser\Desktop)
          at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:214)
          at winstone.HostConfiguration.<init>(HostConfiguration.java:73)
          at winstone.HostGroup.initHost(HostGroup.java:85)
          at winstone.HostGroup.<init>(HostGroup.java:45)
          at winstone.Launcher.<init>(Launcher.java:196)
          at winstone.Launcher.main(Launcher.java:391)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at Main.main(Main.java:146)
          at JNLPMain.main(JNLPMain.java:27)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at com.sun.javaws.Launcher.executeApplication(Unknown Source)
          at com.sun.javaws.Launcher.executeMainClass(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)

          I'm running in Vista, 32-bit, tried with Firefox and IE, Java 6.

          lukewpatterson added a comment - Tried just now, getting: winstone.WinstoneException: The warfile supplied is unavailable or invalid (C:\Users\redactedUser\Desktop) at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:214) at winstone.HostConfiguration.<init>(HostConfiguration.java:73) at winstone.HostGroup.initHost(HostGroup.java:85) at winstone.HostGroup.<init>(HostGroup.java:45) at winstone.Launcher.<init>(Launcher.java:196) at winstone.Launcher.main(Launcher.java:391) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at Main.main(Main.java:146) at JNLPMain.main(JNLPMain.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(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) I'm running in Vista, 32-bit, tried with Firefox and IE, Java 6.

          Jesse Glick added a comment -

          The fix should take effect when the next Hudson release is made.

          Jesse Glick added a comment - The fix should take effect when the next Hudson release is made.

          Jesse Glick added a comment -

          Fix does not work when the JAR is accessed over http protocol rather than file
          protocol.

          Jesse Glick added a comment - Fix does not work when the JAR is accessed over http protocol rather than file protocol.

          Code changed in hudson
          User: : jglick
          Path:
          trunk/hudson/extras/executable-war/src/main/java/Main.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=15718
          Log:
          [FIXED JENKINS-2326] Previous fix did not work over HTTP.
          Since JDK 6 javaws seems to go out of its way to prevent you from finding the location of the cache,
          simply create a temporary copy of hudson.jar to run from.
          This might result in a double download (hard to tell from a test environment), but at least it is transparent.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : jglick Path: trunk/hudson/extras/executable-war/src/main/java/Main.java http://fisheye4.cenqua.com/changelog/hudson/?cs=15718 Log: [FIXED JENKINS-2326] Previous fix did not work over HTTP. Since JDK 6 javaws seems to go out of its way to prevent you from finding the location of the cache, simply create a temporary copy of hudson.jar to run from. This might result in a double download (hard to tell from a test environment), but at least it is transparent.

          Code changed in hudson
          User: : jglick
          Path:
          trunk/hudson/main/war/pom.xml
          http://fisheye4.cenqua.com/changelog/hudson/?cs=15722
          Log:
          JENKINS-2326 Using new executable-war.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : jglick Path: trunk/hudson/main/war/pom.xml http://fisheye4.cenqua.com/changelog/hudson/?cs=15722 Log: JENKINS-2326 Using new executable-war.

          Jesse Glick added a comment -
              • Issue 2844 has been marked as a duplicate of this issue. ***

          Jesse Glick added a comment - Issue 2844 has been marked as a duplicate of this issue. ***

          Jesse Glick added a comment -

          In issue #2844 kohsuke mentions that another workaround could be to use
          reflection to access JarFile.name.

          Jesse Glick added a comment - In issue #2844 kohsuke mentions that another workaround could be to use reflection to access JarFile.name.

          is this
          https://bugs.eclipse.org/bugs/show_bug.cgi?id=244311
          the same kind of problem?

          lukewpatterson added a comment - is this https://bugs.eclipse.org/bugs/show_bug.cgi?id=244311 the same kind of problem?

          huybrechts added a comment -

          This one actually: https://bugs.eclipse.org/bugs/show_bug.cgi?id=240500

          This is the equinox fix:

          private String extractInnerURL(URL url) {
          try {
          URLConnection connection = null;
          try {
          connection = url.openConnection();
          if (connection instanceof JarURLConnection)

          { JarFile jarFile = ((JarURLConnection) connection).getJarFile(); String name = jarFile.getName(); // Some VMs may not return a jar name as a security precaution if (name == null || name.length() == 0) name = getJarNameByReflection(jarFile); if (name != null && name.length() > 0) return "file:" + name; //$NON- NLS-1$ }

          } finally

          { if (connection != null) connection.getInputStream().close(); }

          } catch (IOException e)

          { //Ignore and return the external form }

          return url.toExternalForm();
          }

          /*

          • Get a value of the ZipFile.name field using reflection.
          • For this to succeed, we need the "suppressAccessChecks" permission.
            */
            private String getJarNameByReflection(JarFile jarFile) {
            if (jarFile == null)
            return null;

          Field nameField = null;
          try

          { nameField = ZipFile.class.getDeclaredField("name"); //$NON-NLS-1$ }

          catch (NoSuchFieldException e1) {
          try

          { nameField = ZipFile.class.getDeclaredField("fileName"); //$NON-NLS-1$ }

          catch (NoSuchFieldException e)

          { //ignore }

          }

          if (nameField == null ||
          Modifier.isStatic(nameField.getModifiers()) || nameField.getType() !=
          String.class)
          return null;

          try

          { nameField.setAccessible(true); return (String) nameField.get(jarFile); }

          catch (SecurityException e)

          { // Don't have permissions, ignore }

          catch (IllegalArgumentException e)

          { // Shouldn't happen } catch (IllegalAccessException e) { // Shouldn't happen }

          return null;
          }

          huybrechts added a comment - This one actually: https://bugs.eclipse.org/bugs/show_bug.cgi?id=240500 This is the equinox fix: private String extractInnerURL(URL url) { try { URLConnection connection = null; try { connection = url.openConnection(); if (connection instanceof JarURLConnection) { JarFile jarFile = ((JarURLConnection) connection).getJarFile(); String name = jarFile.getName(); // Some VMs may not return a jar name as a security precaution if (name == null || name.length() == 0) name = getJarNameByReflection(jarFile); if (name != null && name.length() > 0) return "file:" + name; //$NON- NLS-1$ } } finally { if (connection != null) connection.getInputStream().close(); } } catch (IOException e) { //Ignore and return the external form } return url.toExternalForm(); } /* Get a value of the ZipFile.name field using reflection. For this to succeed, we need the "suppressAccessChecks" permission. */ private String getJarNameByReflection(JarFile jarFile) { if (jarFile == null) return null; Field nameField = null; try { nameField = ZipFile.class.getDeclaredField("name"); //$NON-NLS-1$ } catch (NoSuchFieldException e1) { try { nameField = ZipFile.class.getDeclaredField("fileName"); //$NON-NLS-1$ } catch (NoSuchFieldException e) { //ignore } } if (nameField == null || Modifier.isStatic(nameField.getModifiers()) || nameField.getType() != String.class) return null; try { nameField.setAccessible(true); return (String) nameField.get(jarFile); } catch (SecurityException e) { // Don't have permissions, ignore } catch (IllegalArgumentException e) { // Shouldn't happen } catch (IllegalAccessException e) { // Shouldn't happen } return null; }

          Jesse Glick added a comment -

          That would work too. Probably more efficient yet more fragile than the current
          fix. No strong opinion.

          Jesse Glick added a comment - That would work too. Probably more efficient yet more fragile than the current fix. No strong opinion.

          i tried again and it works now, thanks!

          lukewpatterson added a comment - i tried again and it works now, thanks!

          Jesse Glick added a comment -

          It does work. The double download is irritating though. I will try to add a
          check for ZipFile.name, falling back to the current impl.

          Jesse Glick added a comment - It does work. The double download is irritating though. I will try to add a check for ZipFile.name, falling back to the current impl.

          Code changed in hudson
          User: : jglick
          Path:
          trunk/hudson/extras/executable-war/src/main/java/Main.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=15793
          Log:
          JENKINS-2326 Faster but less portable technique tried first.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : jglick Path: trunk/hudson/extras/executable-war/src/main/java/Main.java http://fisheye4.cenqua.com/changelog/hudson/?cs=15793 Log: JENKINS-2326 Faster but less portable technique tried first.

          Code changed in hudson
          User: : jglick
          Path:
          trunk/hudson/main/war/pom.xml
          http://fisheye4.cenqua.com/changelog/hudson/?cs=15797
          Log:
          JENKINS-2326 Using executable-war-1.7.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : jglick Path: trunk/hudson/main/war/pom.xml http://fisheye4.cenqua.com/changelog/hudson/?cs=15797 Log: JENKINS-2326 Using executable-war-1.7.

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: