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

After 2.320 upgrade: errors in maven project (com.google.inject.CreationException: Unable to create injector))

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • core, maven-plugin
    • Jenkins 2.320, Maven Integration plugin 3.15.1, Maven Metadata Plugin for Jenkins CI server 2.0.0, Maven Release Plug-in Plug-in 0.16.2

      After Upgrading from Jenkins 2.319 to Jenkins 2.320 yesterday (following the instructions to update all plugins both before and after the upgrade), all maven projects started to failed with below error.
      Reverting to Jenkins 2.319 solved the issue. It's possible that this is not Jenkins core but a specific (maven) plugin missing a Guava upgrade, but since no updates are available as yet this is definitely a problem.

       > D:\ServApps\git\cmd\git.exe rev-list --no-walk a0269ab032c7e39a61878026a47e57101b708c50 # timeout=10 > D:\ServApps\git\cmd\git.exe rev-list --no-walk a0269ab032c7e39a61878026a47e57101b708c50 # timeout=10Posting build status of INPROGRESS to Bitbucket for commit id [58ab50ad71228eb727b30f32f951d00a294b4125] and ref 'refs/heads/feature/refactor-ajax-calls'Parsing POMsERROR: Processing failed due to a bug in the code. Please report this to the issue tracker (https://jenkins.io/redirect/report-an-issue).com.google.inject.CreationException: Unable to create injector, see the following errors:
      1) Error injecting method, java.lang.NoSuchMethodError: com.google.common.base.Objects.toStringHelper(Ljava/lang/Class;)Lcom/google/common/base/Objects$ToStringHelper;  at org.eclipse.sisu.inject.DefaultBeanLocator.autoPublish(DefaultBeanLocator.java:197)  at org.codehaus.plexus.DefaultPlexusContainer$ContainerModule.configure(DefaultPlexusContainer.java:834) (via modules: org.eclipse.sisu.wire.WireModule -> org.codehaus.plexus.DefaultPlexusContainer$ContainerModule)
      1 error at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466) at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:176) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110) at com.google.inject.Guice.createInjector(Guice.java:96) at com.google.inject.Guice.createInjector(Guice.java:73) at com.google.inject.Guice.createInjector(Guice.java:62) at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:481) at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:206) at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:168) at hudson.maven.MavenEmbedderUtils.buildPlexusContainer(MavenEmbedderUtils.java:166) at hudson.maven.MavenEmbedderUtils.buildPlexusContainer(MavenEmbedderUtils.java:159) at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:110) at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:137) at hudson.maven.MavenUtil.createEmbedder(MavenUtil.java:211) at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1324) at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1124) at hudson.FilePath.act(FilePath.java:1171) at hudson.FilePath.act(FilePath.java:1154) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:985) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:689) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:520) at hudson.model.Run.execute(Run.java:1888) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)Caused by: java.lang.NoSuchMethodError: com.google.common.base.Objects.toStringHelper(Ljava/lang/Class;)Lcom/google/common/base/Objects$ToStringHelper; at com.google.inject.internal.InstanceBindingImpl.toString(InstanceBindingImpl.java:92) at java.base/java.lang.String.valueOf(String.java:2951) at java.base/java.lang.StringBuilder.append(StringBuilder.java:168) at org.eclipse.sisu.inject.Logs.toString(Logs.java:205) at org.eclipse.sisu.inject.InjectorBindings.toString(InjectorBindings.java:129) at java.base/java.lang.String.valueOf(String.java:2951) at java.base/java.lang.StringBuilder.append(StringBuilder.java:168) at org.eclipse.sisu.inject.Logs.format(Logs.java:257) at org.eclipse.sisu.inject.Logs.trace(Logs.java:103) at org.eclipse.sisu.inject.DefaultBeanLocator.add(DefaultBeanLocator.java:91) at org.eclipse.sisu.inject.DefaultBeanLocator.staticAutoPublish(DefaultBeanLocator.java:203) at org.eclipse.sisu.inject.DefaultBeanLocator.autoPublish(DefaultBeanLocator.java:197) at org.eclipse.sisu.inject.DefaultBeanLocator$$FastClassByGuice$$5c8e0cfd.invoke(<generated>) at com.google.inject.internal.cglib.reflect.$FastMethod.invoke(FastMethod.java:53) at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:57) at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:91) at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132) at com.google.inject.internal.MembersInjectorImpl$1$1.call(MembersInjectorImpl.java:88) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115) at org.eclipse.sisu.bean.BeanScheduler$CycleActivator.onProvision(BeanScheduler.java:230) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126) at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68) at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:86) at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:80) at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80) at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:174) at com.google.inject.internal.Initializer.injectAll(Initializer.java:108) at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:174) ... 23 more

          [JENKINS-67102] After 2.320 upgrade: errors in maven project (com.google.inject.CreationException: Unable to create injector))

          Basil Crow added a comment -

          com.google.common.base.Objects#toStringHelper was indeed removed in Guava 21.0, but I cannot reproduce the problem either (a) by running maven-plugin's test suite against Jenkins 2.320 or (b) by creating a Maven job in the UI in Jenkins 2.320 building https://github.com/jglick/simple-maven-project-with-tests.git against Maven 3.8.3 and 3.6.3. Please refer to the 4th point in the Reporting issues section of the blog post:

          Provide steps to reproduce the issue from scratch on a minimal Jenkins installation; the scenario should fail when the steps are followed on Jenkins 2.320 or later and pass when the steps are followed on Jenkins 2.319 or earlier.

          Basil Crow added a comment - com.google.common.base.Objects#toStringHelper was indeed removed in Guava 21.0, but I cannot reproduce the problem either (a) by running maven-plugin 's test suite against Jenkins 2.320 or (b) by creating a Maven job in the UI in Jenkins 2.320 building https://github.com/jglick/simple-maven-project-with-tests.git against Maven 3.8.3 and 3.6.3. Please refer to the 4th point in the Reporting issues section of the blog post : Provide steps to reproduce the issue from scratch on a minimal Jenkins installation; the scenario should fail when the steps are followed on Jenkins 2.320 or later and pass when the steps are followed on Jenkins 2.319 or earlier.

          Basil Crow added a comment -

          Incremental build 3.16-rc2371.251c5f5ad078 is available for testing. The incremental build is available from: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/main/maven-plugin/3.16-rc2371.251c5f5ad078/

          mwwatzdorf Can you please test the incremental build and confirm the issue is resolved? For instructions on how to install a custom build, see: https://www.jenkins.io/doc/book/managing/plugins/#advanced-installation

          Basil Crow added a comment - Incremental build 3.16-rc2371.251c5f5ad078 is available for testing. The incremental build is available from: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/main/maven-plugin/3.16-rc2371.251c5f5ad078/ mwwatzdorf Can you please test the incremental build and confirm the issue is resolved? For instructions on how to install a custom build, see: https://www.jenkins.io/doc/book/managing/plugins/#advanced-installation

          Mark Watzdorf added a comment -

          My apologies for not providing the reproduction steps as per your previous comment in the meantime Basil, production problems at work got in the way...
          However thank you for your unrelenting effort in the mean time! 

          Following your last suggestions,
          I updated all plugins in 2.319, restarted, all still works.

          Unfortunately at this point today, jenkins 2.321 was presented as the automatic upgrade version. I googled but could not find a link to download 2.320 again.
          So I upgraded jenkins to 2.321, (no new plugin upgrades detected afterwards), ran the build... and now everything works! maven integration plugin at this point was as 3.15.1 by the way.

          jenkins 2.321 (or intermediate plugin updates?) seems to have fixed the issue already!

          However to not make your effort go to waste, I manually installed the 3.16-rc plugin, restarted, and tried again:
          everything still works fine with jenkins 2.3.21 and plugin 3.16-rc2371.251c5f5ad078, so I'll leave that one installed for now just in case.

          Unless anything else pops up today, I think you can close this issue.
          Thanks again for your great support!

           

          Mark Watzdorf added a comment - My apologies for not providing the reproduction steps as per your previous comment in the meantime Basil, production problems at work got in the way... However thank you for your unrelenting effort in the mean time!  Following your last suggestions, I updated all plugins in 2.319, restarted, all still works. Unfortunately at this point today, jenkins 2.321 was presented as the automatic upgrade version. I googled but could not find a link to download 2.320 again. So I upgraded jenkins to 2.321, (no new plugin upgrades detected afterwards), ran the build... and now everything works! maven integration plugin at this point was as 3.15.1 by the way. jenkins 2.321 (or intermediate plugin updates?) seems to have fixed the issue already! However to not make your effort go to waste, I manually installed the 3.16-rc plugin, restarted, and tried again: everything still works fine with jenkins 2.3.21 and plugin 3.16-rc2371.251c5f5ad078, so I'll leave that one installed for now just in case. Unless anything else pops up today, I think you can close this issue. Thanks again for your great support!  

          Basil Crow added a comment -

          I think you can close this issue.

          Done

          Basil Crow added a comment - I think you can close this issue. Done

            Unassigned Unassigned
            mwwatzdorf Mark Watzdorf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: