Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7890

Hudson CI start-up with IBM JDK 6 reports java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Component/s: _unsorted
    • Labels:
    • Environment:
    • Similar Issues:

      Description

      When Hudson CI is started using IBM JDK 6 via java -jar hudson.war, the following is output to the console:

      [Winstone 2010/10/25 08:21:40] - Error starting listener instance
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:516)
      at winstone.Launcher.spawnListener(Launcher.java:232)
      at winstone.Launcher.<init>(Launcher.java:205)
      at winstone.Launcher.main(Launcher.java:391)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:600)
      at Main.main(Main.java:200)
      Caused by: java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen
      at winstone.ssl.HttpsListener.<init>(HttpsListener.java:111)
      ... 12 more
      Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen
      at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:77)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:385)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:653)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:619)
      ... 13 more

      According to the Winstone website (http://winstone.sourceforge.net/), the following option can be used to set the KeyManagerFactory:

      --httpsKeyManagerType = the SSL KeyManagerFactory type (eg SunX509, IbmX509). Default is SunX509

      This option (or something similar) should be supported by the Hudson CI start up to allow IBM JDK 6 startup to complete without reporting any errors.

        Attachments

          Activity

          Hide
          danielbeck Daniel Beck added a comment -

          Jenkins moved from Winstone to Jetty as embedded container in 1.535 or so, so this issue is obsolete.

          Show
          danielbeck Daniel Beck added a comment - Jenkins moved from Winstone to Jetty as embedded container in 1.535 or so, so this issue is obsolete.
          Hide
          docwhat Christian Höltje added a comment -

          I'm running 1.554.1 (the current LTS) and it has winstone, not jetty. When will it be in the LTS release?

          Show
          docwhat Christian Höltje added a comment - I'm running 1.554.1 (the current LTS) and it has winstone, not jetty. When will it be in the LTS release?
          Hide
          danielbeck Daniel Beck added a comment -

          If you run it as java -jar jenkins.war, you have Jetty – it's just that for compatibility reasons, a wrapper around that was retained that e.g. logs messages as "winstone". Internally, it's Jetty, and should say so in the log when starting up.

          Show
          danielbeck Daniel Beck added a comment - If you run it as java -jar jenkins.war , you have Jetty – it's just that for compatibility reasons, a wrapper around that was retained that e.g. logs messages as "winstone". Internally, it's Jetty, and should say so in the log when starting up.
          Hide
          agallardo Alberto Gallardo added a comment - - edited

          Seen this issue in a recent jenkins running on IBM Java.

          # java -jar /usr/lib/jenkins/jenkins.war --version
          Running from: /usr/lib/jenkins/jenkins.war
          webroot: $user.home/.jenkins
          1.638
          
          #java -version
          java version "1.7.0"
          Java(TM) SE Runtime Environment (build pxa6470_27sr3fp10-20150708_01(SR3 FP10))
          IBM J9 VM (build 2.7, JRE 1.7.0 Linux amd64-64 Compressed References 20150630_255653 (JIT enabled, AOT enabled)
          J9VM - R27_Java727_SR3_20150630_2236_B255653
          JIT  - tr.r13.java_20150623_94888.01
          GC   - R27_Java727_SR3_20150630_2236_B255653_CMPRSS
          J9CL - 20150630_255653)
          JCL - 20150628_01 based on Oracle jdk7u85-b15
          
          # cat /etc/SuSE-release 
          SUSE Linux Enterprise Server 11 (x86_64)
          VERSION = 11
          PATCHLEVEL = 4
          
          # tail -1 /etc/sysconfig/jenkins
          JENKINS_ARGS="--httpsPort=8443"
          

          Notice that Java IBM comes with a com.ibm.security.x509.CertAndKeyGen (provided in lib/ibmpkcs.jar) in contrast to the requested sun.security.x509.CertAndKeyGen.

          Logs:

          Running from: /usr/lib/jenkins/jenkins.war
          Nov 23, 2015 4:57:03 PM winstone.Logger logInternal
          INFO: Beginning extraction from war file
          Using one-time self-signed certificate
          Nov 23, 2015 4:57:03 PM winstone.Logger logInternal
          INFO: Winstone shutdown successfully
          Nov 23, 2015 4:57:03 PM winstone.Logger logInternal
          SEVERE: Container startup failed
          java.io.IOException: Failed to start a listener: winstone.HttpsConnectorFactory
          	at winstone.Launcher.spawnListener(Launcher.java:209)
          	at winstone.Launcher.<init>(Launcher.java:149)
          	at winstone.Launcher.main(Launcher.java:354)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
          	at java.lang.reflect.Method.invoke(Method.java:620)
          	at Main._main(Main.java:293)
          	at Main.main(Main.java:98)
          Caused by: java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen
          	at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:100)
          	at winstone.Launcher.spawnListener(Launcher.java:207)
          	... 8 more
          Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen
          	at java.net.URLClassLoader.findClass(URLClassLoader.java:600)
          	at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:786)
          	at java.lang.ClassLoader.loadClass(ClassLoader.java:760)
          	at java.lang.ClassLoader.loadClass(ClassLoader.java:741)
          	... 10 more
          
          Show
          agallardo Alberto Gallardo added a comment - - edited Seen this issue in a recent jenkins running on IBM Java. # java -jar /usr/lib/jenkins/jenkins.war --version Running from: /usr/lib/jenkins/jenkins.war webroot: $user.home/.jenkins 1.638 #java -version java version "1.7.0" Java(TM) SE Runtime Environment (build pxa6470_27sr3fp10-20150708_01(SR3 FP10)) IBM J9 VM (build 2.7, JRE 1.7.0 Linux amd64-64 Compressed References 20150630_255653 (JIT enabled, AOT enabled) J9VM - R27_Java727_SR3_20150630_2236_B255653 JIT - tr.r13.java_20150623_94888.01 GC - R27_Java727_SR3_20150630_2236_B255653_CMPRSS J9CL - 20150630_255653) JCL - 20150628_01 based on Oracle jdk7u85-b15 # cat /etc/SuSE-release SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 4 # tail -1 /etc/sysconfig/jenkins JENKINS_ARGS="--httpsPort=8443" Notice that Java IBM comes with a com.ibm.security.x509.CertAndKeyGen (provided in lib/ibmpkcs.jar ) in contrast to the requested sun.security.x509.CertAndKeyGen . Logs: Running from: /usr/lib/jenkins/jenkins.war Nov 23, 2015 4:57:03 PM winstone.Logger logInternal INFO: Beginning extraction from war file Using one-time self-signed certificate Nov 23, 2015 4:57:03 PM winstone.Logger logInternal INFO: Winstone shutdown successfully Nov 23, 2015 4:57:03 PM winstone.Logger logInternal SEVERE: Container startup failed java.io.IOException: Failed to start a listener: winstone.HttpsConnectorFactory at winstone.Launcher.spawnListener(Launcher.java:209) at winstone.Launcher.<init>(Launcher.java:149) at winstone.Launcher.main(Launcher.java:354) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at Main._main(Main.java:293) at Main.main(Main.java:98) Caused by: java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:100) at winstone.Launcher.spawnListener(Launcher.java:207) ... 8 more Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen at java.net.URLClassLoader.findClass(URLClassLoader.java:600) at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:786) at java.lang.ClassLoader.loadClass(ClassLoader.java:760) at java.lang.ClassLoader.loadClass(ClassLoader.java:741) ... 10 more

            People

            • Assignee:
              Unassigned
              Reporter:
              jkwuc89 jkwuc89
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: