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

[Guice/MissingConstructor]: No injectable constructor for type Publisher$DescriptorImpl.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • testng-plugin
    • None
    • Jenkins 2.387.1
      TestNG 730.v4c5283037693
      Job DSL 1.83

      Pipeline job calling jobDsl keyword with scriptText that includes the following:

      mavenJob('foo') {
          publishers {
              testNG {
                  escapeExceptionMsg true
                  escapeTestDescp true
                  failedFails 100
                  failedSkips 100
                  failureOnFailedTestConfig false
                  reportFilenamePattern '${TEST_MODULE}/target/surefire-reports/testng-results.xml'
                  showFailedBuilds false
                  thresholdMode 2
                  unstableFails 0
                  unstableSkips 100
          }
      }
      

      Error:

      ERROR: Guice configuration errors:
      
      1) [Guice/MissingConstructor]: No injectable constructor for type Publisher$DescriptorImpl.
      
      class Publisher$DescriptorImpl has a private no-arg constructor but the class is not private. Guice can only use a private no-arg constructor if it is defined in a private class.
      
      Requested by:
      1  : Publisher$DescriptorImpl.class(Publisher.java:446)
           while locating Publisher$DescriptorImpl
      
      Learn more:
        https://github.com/google/guice/wiki/MISSING_CONSTRUCTOR
      
      1 error
      

      The following diff seems to fix the error:

      --- src/main/java/hudson/plugins/testng/Publisher.java
      +++ src/main/java/hudson/plugins/testng/Publisher.java
      @@ -462,7 +462,7 @@ public class Publisher extends Recorder implements SimpleBuildStep {
           public static final class DescriptorImpl extends BuildStepDescriptor<hudson.tasks.Publisher> {
      
               /** Do not instantiate DescriptorImpl. */
      -        private DescriptorImpl() {
      +        public DescriptorImpl() {
                   super(Publisher.class);
               }
      

            Unassigned Unassigned
            josb Jos Backus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: