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

NoClassDefFoundError during startup (Template Project plugin 1.5)

      After upgrading the Template Project Plugin from 1.4.2 to 1.5 following error is thrown during startup of Jenkins:

      PM WARNING hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error

      Failed to instantiate Key[type=hudson.plugins.templateproject.ProxySCM$DescriptorImpl, annotation=[none]]; skipping this component
      com.google.inject.ProvisionException: Guice provision errors:

      1) Error injecting constructor, java.lang.NoClassDefFoundError: org/jenkinsci/plugins/multiplescms/MultiSCMRevisionState
      at hudson.plugins.templateproject.ProxySCM$DescriptorImpl.<init>(ProxySCM.java:112)

      1 error
      at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
      at com.google.inject.Scopes$1$1.get(Scopes.java:65)
      at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:427)
      at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
      at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:1005)
      at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1051)
      at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:1001)
      at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:389)
      at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:380)
      at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:386)
      at hudson.ExtensionList.load(ExtensionList.java:300)
      at hudson.ExtensionList.ensureLoaded(ExtensionList.java:253)
      at hudson.ExtensionList.iterator(ExtensionList.java:143)
      at jenkins.model.Jenkins.getDescriptorByType(Jenkins.java:1192)
      at hudson.plugins.copyartifact.BuildSelectorParameter.initAliases(BuildSelectorParameter.java:135)
      at hudson.plugins.copyartifact.CopyArtifactPlugin.postInitialize(CopyArtifactPlugin.java:35)
      at hudson.PluginManager$2$1$2.run(PluginManager.java:389)
      at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
      at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
      at jenkins.model.Jenkins$7.runTask(Jenkins.java:904)
      at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
      at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/multiplescms/MultiSCMRevisionState
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
      at java.lang.Class.getMethod0(Class.java:2856)
      at java.lang.Class.getMethod(Class.java:1668)
      at hudson.model.Descriptor.<init>(Descriptor.java:286)
      at hudson.scm.SCMDescriptor.<init>(SCMDescriptor.java:71)
      at hudson.plugins.templateproject.ProxySCM$DescriptorImpl.<init>(ProxySCM.java:112)
      at hudson.plugins.templateproject.ProxySCM$DescriptorImpl$$FastClassByGuice$$4e632614.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:108)
      at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
      at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
      at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
      at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1058)
      at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
      ... 24 more
      Caused by: java.lang.ClassNotFoundException: org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState
      at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1375)
      at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1325)
      at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1078)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      ... 40 more

          [JENKINS-30243] NoClassDefFoundError during startup (Template Project plugin 1.5)

          Brantone added a comment -

          I did also get that "Caught exception evaluating: h.getRelativeLinkTo(job)" error , and able to reproduce it on initial hit after launching Jenkins, but stack trace doesn't point to template-project , at least at first glance.
          Will try to dig into it, not sure if this is new as that aspect hasn't changed.

          Brantone added a comment - I did also get that "Caught exception evaluating: h.getRelativeLinkTo(job)" error , and able to reproduce it on initial hit after launching Jenkins, but stack trace doesn't point to template-project , at least at first glance. Will try to dig into it, not sure if this is new as that aspect hasn't changed.

          Here's the complete plugin list:

          • All changes plugin 1.3
          • AnsiColor 0.4.1
          • Authorize Project 1.1.0
          • Build Blocker Plugin 1.7.1
          • Build Pipeline Plugin 1.4.7
          • build timeout plugin 1.15
          • Checkstyle Plug-in 3.42
          • Copy Artifact Plugin 1.35.2
          • Credentials Plugin 1.22
          • Dashboard View 2.9.6
          • disk-usage plugin 0.25
          • Downstream build view 1.9
          • Email Extension Plugin 2.40.5
          • Environment Injector Plugin 1.92.1
          • Favorite 1.16
          • GIT client plugin 1.19.0
          • Git Parameter Plug-In 0.4.0
          • GIT plugin 2.4.0
          • Green Balls 1.14
          • Groovy 1.27
          • Groovy Postbuild 2.2.1
          • HTML Publisher plugin 1.6
          • jQuery plugin 1.11.2-0
          • JUnit Plugin 1.8
          • Mailer Plugin 1.15
          • Matrix Authorization Strategy Plugin 1.2
          • Matrix Project Plugin 1.6
          • Nested View Plugin 1.14
          • OWASP Markup Formatter Plugin 1.3
          • Parameterized Trigger plugin 2.28
          • PegDown Formatter Plugin 1.3
          • Redmine plugin 0.15
          • SCM API Plugin 0.2
          • SCM Sync Configuration Plugin 0.0.8
          • Script Security Plugin 1.15
          • Sidebar Link 1.7
          • SiteMonitor Plugin 0.4
          • SSH Credentials Plugin 1.11
          • Static Analysis Utilities 1.72
          • Subversion Plug-in 2.5.2
          • Template Project plugin 1.4.2
          • Token Macro Plugin 1.10
          • user build vars plugin 1.4
          • Workflow: Step API 1.10
          • Workspace Cleanup Plugin 0.28
          • xUnit plugin 1.97

          Thorsten Kahler added a comment - Here's the complete plugin list: All changes plugin 1.3 AnsiColor 0.4.1 Authorize Project 1.1.0 Build Blocker Plugin 1.7.1 Build Pipeline Plugin 1.4.7 build timeout plugin 1.15 Checkstyle Plug-in 3.42 Copy Artifact Plugin 1.35.2 Credentials Plugin 1.22 Dashboard View 2.9.6 disk-usage plugin 0.25 Downstream build view 1.9 Email Extension Plugin 2.40.5 Environment Injector Plugin 1.92.1 Favorite 1.16 GIT client plugin 1.19.0 Git Parameter Plug-In 0.4.0 GIT plugin 2.4.0 Green Balls 1.14 Groovy 1.27 Groovy Postbuild 2.2.1 HTML Publisher plugin 1.6 jQuery plugin 1.11.2-0 JUnit Plugin 1.8 Mailer Plugin 1.15 Matrix Authorization Strategy Plugin 1.2 Matrix Project Plugin 1.6 Nested View Plugin 1.14 OWASP Markup Formatter Plugin 1.3 Parameterized Trigger plugin 2.28 PegDown Formatter Plugin 1.3 Redmine plugin 0.15 SCM API Plugin 0.2 SCM Sync Configuration Plugin 0.0.8 Script Security Plugin 1.15 Sidebar Link 1.7 SiteMonitor Plugin 0.4 SSH Credentials Plugin 1.11 Static Analysis Utilities 1.72 Subversion Plug-in 2.5.2 Template Project plugin 1.4.2 Token Macro Plugin 1.10 user build vars plugin 1.4 Workflow: Step API 1.10 Workspace Cleanup Plugin 0.28 xUnit plugin 1.97

          Idan Bidani added a comment - - edited

          same issue here, I don't have "Multiple SCMs plugin" plugin installed.
          Installing it solves the issue.
          seems like issue introduced in b6fe18f480f1216777400e56b1fae851665903a9 commit.
          brantone Is there any way to make "Multiple SCMs plugin" dependency no mandatory?

          Idan Bidani added a comment - - edited same issue here, I don't have "Multiple SCMs plugin" plugin installed. Installing it solves the issue. seems like issue introduced in b6fe18f480f1216777400e56b1fae851665903a9 commit. brantone Is there any way to make "Multiple SCMs plugin" dependency no mandatory?

          I hit this issue too and installing Multiple SCMs plugin also removed this from logs, thanks! Prob needs to be made an explicit dependency

          fergal monaghan added a comment - I hit this issue too and installing Multiple SCMs plugin also removed this from logs, thanks! Prob needs to be made an explicit dependency

          Brantone added a comment -

          Hmmm, I was hoping to get away from explicit dependency since it's a bit of a hack to include a plugin for the sake of a single "if".
          I'll revisit that if block to fix it up proper.

          Brantone added a comment - Hmmm, I was hoping to get away from explicit dependency since it's a bit of a hack to include a plugin for the sake of a single "if". I'll revisit that if block to fix it up proper.

          Brantone added a comment -

          Trying out a few possibilities and I'm not longer hitting the issue that warranted that check for `instanceof`, so I wonder if previous updates to multiple-scms-plugin have taken care of it as the comments allude to:
          https://github.com/Brantone/template-project-plugin/blob/b6fe18f480f1216777400e56b1fae851665903a9/src/main/java/hudson/plugins/templateproject/ProxySCM.java#L78

          Brantone added a comment - Trying out a few possibilities and I'm not longer hitting the issue that warranted that check for `instanceof`, so I wonder if previous updates to multiple-scms-plugin have taken care of it as the comments allude to: https://github.com/Brantone/template-project-plugin/blob/b6fe18f480f1216777400e56b1fae851665903a9/src/main/java/hudson/plugins/templateproject/ProxySCM.java#L78

          I'm getting

          Nov 16, 2015 10:00:27 AM hudson.ExpressionFactory2$JexlExpression evaluate
          WARNING: Caught exception evaluating: h.getRelativeLinkTo(job) in /job/[foo]/configure. Reason: java.lang.NullPointerException
          java.lang.NullPointerException
          

          (no backtrace, any ideas on why I don't get a backtrace here?) quite often. I do have "Multiple SCMs" installed. Some of the jobs that trigger the error when entering their configuration screen do not use template-project, some do. What can I do? Should I file a separate bug?

          Tomasz Śniatowski added a comment - I'm getting Nov 16, 2015 10:00:27 AM hudson.ExpressionFactory2$JexlExpression evaluate WARNING: Caught exception evaluating: h.getRelativeLinkTo(job) in /job/[foo]/configure. Reason: java.lang.NullPointerException java.lang.NullPointerException (no backtrace, any ideas on why I don't get a backtrace here?) quite often. I do have "Multiple SCMs" installed. Some of the jobs that trigger the error when entering their configuration screen do not use template-project, some do. What can I do? Should I file a separate bug?

          Brantone added a comment - - edited

          tsniatowski : can you trace that error back to Template Plugin? If some cause it but others don't, might not be Template
          EDIT:
          Let me take that back, I actually found how/why that's happening. That error itself is actually different than the one for this ticket, so new ticket should be created (unless I fix the bug first, it's a race )

          Brantone added a comment - - edited tsniatowski : can you trace that error back to Template Plugin? If some cause it but others don't, might not be Template EDIT: Let me take that back, I actually found how/why that's happening. That error itself is actually different than the one for this ticket, so new ticket should be created (unless I fix the bug first, it's a race )

          Same issue found today on V2.121.1.2

           

          WARNING: Failed to instantiate Key[type=hudson.plugins.templateproject.ProxySCM$DescriptorImpl, annotation=[none]]; skipping this component
          com.google.inject.ProvisionException: Unable to provision, see the following errors:

          1) Error injecting constructor, java.lang.NoClassDefFoundError: org/jenkinsci/plugins/multiplescms/MultiSCMRevisionState
          at hudson.plugins.templateproject.ProxySCM$DescriptorImpl.<init>(ProxySCM.java:113)

          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:482)
          at hudson.ExtensionList.load(ExtensionList.java:380)
          at hudson.ExtensionList.ensureLoaded(ExtensionList.java:318)
          at hudson.ExtensionList.iterator(ExtensionList.java:172)
          at jenkins.model.Jenkins.getDescriptorByType(Jenkins.java:1524)
          at com.cloudbees.jenkins.plugins.jsync.archiver.JSyncArtifactManagerFactory.upgrade(JSyncArtifactManagerFactory.java:51)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          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:296)
          at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068)
          at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
          at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:748)
          Caused by: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/multiplescms/MultiSCMRevisionState

          Frédéric Meyrou added a comment - Same issue found today on V2.121.1.2   WARNING: Failed to instantiate Key[type=hudson.plugins.templateproject.ProxySCM$DescriptorImpl, annotation= [none] ]; skipping this component com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) Error injecting constructor, java.lang.NoClassDefFoundError: org/jenkinsci/plugins/multiplescms/MultiSCMRevisionState at hudson.plugins.templateproject.ProxySCM$DescriptorImpl.<init>(ProxySCM.java:113) 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:482) at hudson.ExtensionList.load(ExtensionList.java:380) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:318) at hudson.ExtensionList.iterator(ExtensionList.java:172) at jenkins.model.Jenkins.getDescriptorByType(Jenkins.java:1524) at com.cloudbees.jenkins.plugins.jsync.archiver.JSyncArtifactManagerFactory.upgrade(JSyncArtifactManagerFactory.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) 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:296) at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/multiplescms/MultiSCMRevisionState

          I believe this is because the optionality of the multiple-scms plugin is not correctly checked on here and here. It needs to be done like described here.

          I created https://github.com/jenkinsci/template-project-plugin/pull/34.

          Adrien Lecharpentier added a comment - I believe this is because the optionality of the multiple-scms plugin is not correctly checked on here and here . It needs to be done like described here . I created https://github.com/jenkinsci/template-project-plugin/pull/34 .

            brantone Brantone
            tkahler Thorsten Kahler
            Votes:
            6 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: