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

[JDK 9] Jenkins does not start with "java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter"

    Details

    • Similar Issues:
    • Released As:
       instance-identity-2.2, jenkins-2.130

      Description

      Fails with the following stack trace.

      INFOS: Augmented all extensions
      sept. 01, 2017 7:23:28 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
      AVERTISSEMENT: Failed to instantiate Key[type=org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl, annotation=[none]]; skip
      ping this component                                                                                                                    
      com.google.inject.ProvisionException: Unable to provision, see the following errors:                                                   
                                                                                                                                            
      1) Error injecting constructor, java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter                                       
       at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl.<init>(PageDecoratorImpl.java:21)                                  
                                                                                                                                            
      1 error                                                                                                                                
             at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)                   
             at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)                                                    
             at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)                                       
             at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)                   
             at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)                                                    
             at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)                                               
             at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)                                                       
             at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:386)                                                          
             at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:377)                                                           
             at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:477)                                                 
             at hudson.ExtensionList.load(ExtensionList.java:365)                                                                           
             at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303)                                                                   
             at hudson.ExtensionList.iterator(ExtensionList.java:157)                                                                       
             at hudson.diagnosis.NullIdDescriptorMonitor.verify(NullIdDescriptorMonitor.java:72)                                            
             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                              
             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)                            
             at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                    
             at java.base/java.lang.reflect.Method.invoke(Method.java:564)                                                                  
             at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)                                                              
             at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)                                                        
             at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)                                                                  
             at jenkins.model.Jenkins$7.runTask(Jenkins.java:1090)                                                                          
             at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)                                                                    
             at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)                                                                 
             at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)                                   
             at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)                                   
             at java.base/java.lang.Thread.run(Thread.java:844)                                                                             
      Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter                                                            
             at org.jenkinsci.main.modules.instance_identity.pem.PEMHelper.writeEncoded(PEMHelper.java:188)                                 
             at org.jenkinsci.main.modules.instance_identity.pem.PEMHelper.encodePEM(PEMHelper.java:113)                                    
             at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.write(InstanceIdentity.java:96)                               
             at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:66)                              
             at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:40)                              
             at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl.<init>(PageDecoratorImpl.java:22)                            
             at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl$$FastClassByGuice$$68618106.newInstance(<generated>)         
             at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)                              
             at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)           
             at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)                                      
             at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)                                       
             at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)                              
             at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)                
             at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)                                               
             at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)                   
             ... 26 more                                                                                                                    
      Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter                                                          
             at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)                                                        
             at org.eclipse.jetty.webapp.WebAppClassLoader.findClass(WebAppClassLoader.java:510)                                            
             at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:441)
      
      

        Attachments

          Issue Links

            Activity

            Hide
            batmat Baptiste Mathus added a comment -

            See https://bugs.openjdk.java.net/browse/JDK-8157670, this can be worked around by adding --add-modules:

            java --add-modules java.xml.bind -jar ~/jenkins.war

            Not marking this resolved though for now, since we will probably want to see if/how we remove that start option.

            Show
            batmat Baptiste Mathus added a comment - See https://bugs.openjdk.java.net/browse/JDK-8157670 , this can be worked around by adding --add-modules : java --add-modules java.xml.bind -jar ~/jenkins.war Not marking this resolved though for now, since we will probably want to see if/how we remove that start option.
            Hide
            markewaite Mark Waite added a comment -

            Refer to my JDK 9 LTS and LTS with plugins docker images for confirmation that this works as described by Baptiste Mathus. In that repository, the docker_run.py and jenkins.sh shell script includes the additional arguments noted by Baptiste.

            Show
            markewaite Mark Waite added a comment - Refer to my JDK 9 LTS and LTS with plugins docker images for confirmation that this works as described by Baptiste Mathus . In that repository, the docker_run.py and jenkins.sh shell script includes the additional arguments noted by Baptiste.
            Hide
            duemir Denys Digtiar added a comment -

            As per http://openjdk.java.net/jeps/320 EE modules are going to be removed from the Java SE

            Show
            duemir Denys Digtiar added a comment - As per  http://openjdk.java.net/jeps/320  EE modules are going to be removed from the Java SE
            Hide
            oleg_nenashev Oleg Nenashev added a comment - - edited

            It is going to happen in Java 11. We are "good" so far though it would be great to migrate away or to detach the dependent code somehow

            Show
            oleg_nenashev Oleg Nenashev added a comment - - edited It is going to happen in Java 11. We are "good" so far though it would be great to migrate away or to detach the dependent code somehow
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            For Java 10/11 all running guidelines are available here: https://jenkins.io/blog/2018/06/17/running-jenkins-with-java10-11/
            For Java 11 we have JENKINS-51821 and JENKINS-51965 to simplify the logic

            Show
            oleg_nenashev Oleg Nenashev added a comment - For Java 10/11 all running guidelines are available here: https://jenkins.io/blog/2018/06/17/running-jenkins-with-java10-11/ For Java 11 we have JENKINS-51821 and JENKINS-51965 to simplify the logic
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Closing since the ticket is no longer relevant (documented "as designed") behavior

            Show
            oleg_nenashev Oleg Nenashev added a comment - Closing since the ticket is no longer relevant (documented "as designed") behavior
            Hide
            batmat Baptiste Mathus added a comment - - edited

            FTR, I do NOT see this anymore while starting Jenkins fresh built 2.158-SNAPSHOT. I can start and build successfully a hello world Pipeline without any option passed on the command line of Jenkins (only --enable-future-java, and yes I triple-checked I'm on Java 11).
            If anyone still knows a reproducer nowadays using a well-known plugin, I'm all ears. I'm still trying in the meantime.

            Show
            batmat Baptiste Mathus added a comment - - edited FTR, I do NOT see this anymore while starting Jenkins fresh built 2.158-SNAPSHOT. I can start and build successfully a hello world Pipeline without any option passed on the command line of Jenkins (only --enable-future-java, and yes I triple-checked I'm on Java 11). If anyone still knows a reproducer nowadays using a well-known plugin, I'm all ears. I'm still trying in the meantime.

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                batmat Baptiste Mathus
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: