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

Combining with xUnit Plugin cause "Failed to instantiate class org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher"

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • None
    • Jenkins 1.532.1
      Flexible Publish plugin 0.12
      Maven Integration plugin 2.0.1
      xUnit plugin 1.80

    Description

      How to recreate:

      • Create a new Maven 2/3 job.
      • Add the flexible publish post-build action
      • Add one condition action (I used xUnit with jUnit on Files Match)
      • Save
      • Edit again, and add another conditional action (I used the JaCoCo publisher with Files Match).
      • Save

      I get: Failed to instantiate class org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher

      I expected it to save.

      Ciao!

      Attachments

        Issue Links

          Activity

            docwhat Christian Höltje created issue -
            docwhat Christian Höltje made changes -
            Field Original Value New Value
            Environment Jenkins 1.532.1 Jenkins 1.532.1
            Flexible Publish plugin 0.12

            With Jenkins 1.509.4, Flexible Publish 0.12 and Maven Project Plugin 1.509.4 it works fine.

            docwhat Christian Höltje added a comment - With Jenkins 1.509.4, Flexible Publish 0.12 and Maven Project Plugin 1.509.4 it works fine.
            docwhat Christian Höltje made changes -
            Environment Jenkins 1.532.1
            Flexible Publish plugin 0.12
            Jenkins 1.532.1
            Flexible Publish plugin 0.12
            Maven Integration plugin 2.0.1

            After you see this error, everything after whatever caused the error in the config.xml disappears, so this is a dangerous problem!!

            docwhat Christian Höltje added a comment - After you see this error, everything after whatever caused the error in the config.xml disappears, so this is a dangerous problem!!
            ikedam ikedam made changes -
            Assignee bap [ bap ] ikedam [ ikedam ]
            ikedam ikedam added a comment -

            It reproduced in my environment.

            1. Install Flexible Publish and xUnit plugin
            2. Create a new Maven 2/3 job.
            3. Add the flexible publish post-build action, and configure "Publish xUnit test result report" in it.
            4. Save
            5. Edit again
            6. Save (no need for modification)

            I get: Failed to instantiate class org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher
            It does not output any stacktraces on browsers nor system logs.

            ikedam ikedam added a comment - It reproduced in my environment. Install Flexible Publish and xUnit plugin Create a new Maven 2/3 job. Add the flexible publish post-build action, and configure "Publish xUnit test result report" in it. Save Edit again Save (no need for modification) I get: Failed to instantiate class org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher It does not output any stacktraces on browsers nor system logs.
            ikedam ikedam added a comment -

            I found it reproduces even free style projects.
            I think this happens combined with xUnit plugin (I updated the summary).
            Please report if you find same problems with other plugins.

            ikedam ikedam added a comment - I found it reproduces even free style projects. I think this happens combined with xUnit plugin (I updated the summary). Please report if you find same problems with other plugins.
            ikedam ikedam made changes -
            Summary Maven jobs: Failed to instantiate class org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher Combining with xUnit Plugin cause "Failed to instantiate class org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher"
            ikedam ikedam made changes -
            Environment Jenkins 1.532.1
            Flexible Publish plugin 0.12
            Maven Integration plugin 2.0.1
            Jenkins 1.532.1
            Flexible Publish plugin 0.12
            Maven Integration plugin 2.0.1
            xUnit plugin 1.80
            ikedam ikedam added a comment -

            I found wrong codes in Flexible publish handling error messages.
            The message "Failed to instantiate class org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher" was wrong,
            but should be:

            Failed to instantiate: class not found ["hudson.tasks.test.AggregatedTestResultPublisher","hudson.tasks.ArtifactArchiver","hudson.tasks.BuildTrigger","hudson.tasks.junit.JUnitResultArchiver","hudson.tasks.JavadocArchiver","org.jenkinsci.plugins.xunit.XUnitPublisher","hudson.tasks.Fingerprinter","hudson.tasks.Mailer"]

            I'll fix this problem (improper error message) in the next release.

            The root cause is that, Jenkins passes a broken json data.
            I attach that json.
            "stapler-class" should be the class name of the selected publisher, but passed a list of all publishers.

            I'm not sure why this happens only when combined with xUnit plugin.

            ikedam ikedam added a comment - I found wrong codes in Flexible publish handling error messages. The message "Failed to instantiate class org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher" was wrong, but should be: Failed to instantiate: class not found ["hudson.tasks.test.AggregatedTestResultPublisher","hudson.tasks.ArtifactArchiver","hudson.tasks.BuildTrigger","hudson.tasks.junit.JUnitResultArchiver","hudson.tasks.JavadocArchiver","org.jenkinsci.plugins.xunit.XUnitPublisher","hudson.tasks.Fingerprinter","hudson.tasks.Mailer"] I'll fix this problem (improper error message) in the next release. The root cause is that, Jenkins passes a broken json data. I attach that json. "stapler-class" should be the class name of the selected publisher, but passed a list of all publishers. I'm not sure why this happens only when combined with xUnit plugin.
            ikedam ikedam made changes -
            Attachment posted_json.txt [ 25203 ]

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/org/jenkins_ci/plugins/flexible_publish/ConditionalPublisher.java
            http://jenkins-ci.org/commit/flexible-publish-plugin/9145b7c4efeed18c0df027f8e378ce099edda8e4
            Log:
            JENKINS-21497 Fixed a wrong error message when failed to instantiate a publisher.

            Compare: https://github.com/jenkinsci/flexible-publish-plugin/compare/f60940f04492...9145b7c4efee

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/org/jenkins_ci/plugins/flexible_publish/ConditionalPublisher.java http://jenkins-ci.org/commit/flexible-publish-plugin/9145b7c4efeed18c0df027f8e378ce099edda8e4 Log: JENKINS-21497 Fixed a wrong error message when failed to instantiate a publisher. Compare: https://github.com/jenkinsci/flexible-publish-plugin/compare/f60940f04492...9145b7c4efee
            ikedam ikedam added a comment -

            xunit-plugin generates broken HTML like this:

                    <tr>
                      <td class="setting-leftspace"> </td>
                      <td class="setting-name">Choose your threshold mode</td>
                      <td class="setting-main">
                       <input name="thresholdMode" value="1" type="radio" checked="true" />
                       <label class="attach-previous">Use a number of tests</label>
                       <br />
                       <input name="thresholdMode" value="2" type="radio" /><label class="attach-previous">Use a percent of tests</label>
                      </td>
                    </tr>
                    <tr class="validation-error-area"><td colspan="2"></td><td></td></tr>
                  </tbody></table>
                </td></tr>
              </td></tr>
              <br /><br />  <!-- This is wrong HTML!!!! -->
              <tr><td colspan="3">
                <tr>
                  <td></td>
                  <td></td>
                  <td>
            

            Web browsers converts this HTML like this:

            ...
            <tr class="dropdownList-container">
              <td colspan="2"></td>
              <td colspan="2">
                <br /><br />  <!-- wrong HTML comes here -->
                <table name="publisher" width="100%">
                <tbody>
                  <tr class="dropdownList-start rowvg-start">
                  <td style="display:none">
                     <input name="stapler-class" value="hudson.tasks.test.AggregatedTestResultPublisher" type="hidden">
                  </td>
            ...
            

            This cause dropdownList work wrong as invalid "br" tags prevents it find out "tr.dropdownList-start".

            ikedam ikedam added a comment - xunit-plugin generates broken HTML like this: <tr> <td class="setting-leftspace"> </td> <td class="setting-name">Choose your threshold mode</td> <td class="setting-main"> <input name="thresholdMode" value="1" type="radio" checked="true" /> <label class="attach-previous">Use a number of tests</label> <br /> <input name="thresholdMode" value="2" type="radio" /><label class="attach-previous">Use a percent of tests</label> </td> </tr> <tr class="validation-error-area"><td colspan="2"></td><td></td></tr> </tbody></table> </td></tr> </td></tr> <br /><br /> <!-- This is wrong HTML!!!! --> <tr><td colspan="3"> <tr> <td></td> <td></td> <td> Web browsers converts this HTML like this: ... <tr class="dropdownList-container"> <td colspan="2"></td> <td colspan="2"> <br /><br /> <!-- wrong HTML comes here --> <table name="publisher" width="100%"> <tbody> <tr class="dropdownList-start rowvg-start"> <td style="display:none"> <input name="stapler-class" value="hudson.tasks.test.AggregatedTestResultPublisher" type="hidden"> </td> ... This cause dropdownList work wrong as invalid "br" tags prevents it find out "tr.dropdownList-start".
            ikedam ikedam made changes -
            Link This issue is related to JENKINS-21532 [ JENKINS-21532 ]
            ikedam ikedam added a comment -

            I created a ticket for xunit plugin: JENKINS-21532
            This would be fixed in that ticket. Won't fix in this ticket.

            Please contact to the maintainer of xunit plugin if you want to hurry that fix.

            ikedam ikedam added a comment - I created a ticket for xunit plugin: JENKINS-21532 This would be fixed in that ticket. Won't fix in this ticket. Please contact to the maintainer of xunit plugin if you want to hurry that fix.
            ikedam ikedam made changes -
            Resolution Won't Fix [ 2 ]
            Status Open [ 1 ] Resolved [ 5 ]

            Fast work! You guys rock!

            docwhat Christian Höltje added a comment - Fast work! You guys rock!
            ikedam ikedam added a comment -

            Fixed in 0.13.
            It will be available in a day.
            Please try that.

            ikedam ikedam added a comment - Fixed in 0.13. It will be available in a day. Please try that.
            ikedam ikedam made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 153363 ] JNJira + In-Review [ 207360 ]

            People

              ikedam ikedam
              docwhat Christian Höltje
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: