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

no known implementation of class jenkins.tasks.SimpleBuildWrapper

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: ansicolor-plugin
    • Labels:
      None
    • Environment:
      fails on OSX, works on Linux
    • Similar Issues:

      Description

      A straightforward JUnit test is failing on OSX and succeeds on Linux, presumably this means the implementation will be broken on OSX as well.

      public class AnsiColorBuildWrapperWorkflowTest {
      	@ClassRule
          public static BuildWatcher buildWatcher = new BuildWatcher();
          
          @Rule
          public RestartableJenkinsRule story = new RestartableJenkinsRule();
      
          @Test
          public void testWorkflowWrap() throws Exception {
              story.addStep(new Statement() {
                  @Override
                  public void evaluate() throws Throwable {
                      Assume.assumeTrue(!Functions.isWindows());
                      WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
                      p.setDefinition(new CpsFlowDefinition(
                              "node {\n"
                              + "  wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2]) {\n"
                              + "    sh(\"\"\"#!/bin/bash\n"
                              + "      echo -e '\\\\e[31mred\\\\e[0m'\"\"\"\n"
                              + "    )\n"
                              + "  }\n"
                              + "}"
                      ));
                      story.j.assertBuildStatusSuccess(p.scheduleBuild2(0));
                      StringWriter writer = new StringWriter();
                      p.getLastBuild().getLogText().writeHtmlTo(0L, writer);
                      assertTrue(writer.toString().matches("(?s).*<span style=\"color: #CD0000;\">red</span>.*"));                        
                  }
              });
          }
      
      }
      
      java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named AnsiColorBuildWrapper
          at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:233)
          at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:186)
          at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:91)
          at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:103)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133)
      

      See https://github.com/dblock/jenkins-ansicolor-plugin/pull/60.

        Attachments

          Activity

          Hide
          rtyler R. Tyler Croy added a comment -

          Daniel Doubrovkine, I think there was some missed context here which led to a misunderstanding. The link to the build in Travis definitely writes off the possibility for a developer-local environment problem IMHO.

          I think making the component ansicolor-plugin until we can isolate it further is a good plan.

          I thought this might be a JDK issue since Owen Mehegan mentioned in this comment that things fail for him when running on OS X with Java 6? A while back we moved the core JRE requirement from JRE6 to JRE7 but it looks like Travis is using JDK7 (java version "1.7.0_45")

          Show
          rtyler R. Tyler Croy added a comment - Daniel Doubrovkine , I think there was some missed context here which led to a misunderstanding. The link to the build in Travis definitely writes off the possibility for a developer-local environment problem IMHO. I think making the component ansicolor-plugin until we can isolate it further is a good plan. I thought this might be a JDK issue since Owen Mehegan mentioned in this comment that things fail for him when running on OS X with Java 6? A while back we moved the core JRE requirement from JRE6 to JRE7 but it looks like Travis is using JDK7 ( java version "1.7.0_45" )
          Hide
          dblock Daniel Doubrovkine added a comment -

          R. Tyler Croy Thanks. I've changed the component for this bug, no problem. If you have OSX give this a try, I am not very familiar with Jenkins internals and this is taking a lot of time just to grok

          Show
          dblock Daniel Doubrovkine added a comment - R. Tyler Croy Thanks. I've changed the component for this bug, no problem. If you have OSX give this a try, I am not very familiar with Jenkins internals and this is taking a lot of time just to grok
          Hide
          jglick Jesse Glick added a comment -

          So you need to see whether DescribableHelper.getDescriptorList includes the instance of AnsiColorBuildWrapper.DescriptorImpl. If so, check findSubtypes and thence coerce. If not, you need to see what is going on in ExtensionList.create and load.

          Show
          jglick Jesse Glick added a comment - So you need to see whether DescribableHelper.getDescriptorList includes the instance of AnsiColorBuildWrapper.DescriptorImpl . If so, check findSubtypes and thence coerce . If not, you need to see what is going on in ExtensionList.create and load .
          Hide
          hammertoe Matt Hamilton added a comment - - edited

          I'm getting the same error here on our build servers. I've just tried to move to Jenkins 2, and need to get ANSI colour working again. Tried to use this build wrapper, but getting the same error as above. The build slave is OSX:

          iosbuilds$ java -version
          java version "1.8.0_60"
          Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
          Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

          iosbuilds$ uname -a
          Darwin Goram.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

          Let me know if I can help in any way.

          -Matt

          EDIT:

          So seems that case sensitivity may be the issue. Using the wrapper declaration:

          {{wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2])

          { }}

          Seems to work on OSX.

          -Matt

          Show
          hammertoe Matt Hamilton added a comment - - edited I'm getting the same error here on our build servers. I've just tried to move to Jenkins 2, and need to get ANSI colour working again. Tried to use this build wrapper, but getting the same error as above. The build slave is OSX: iosbuilds$ java -version java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) iosbuilds$ uname -a Darwin Goram.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64 Let me know if I can help in any way. -Matt EDIT: So seems that case sensitivity may be the issue. Using the wrapper declaration: {{wrap( [$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2] ) { }} Seems to work on OSX. -Matt
          Hide
          tpeters Teresa Peters added a comment -

          This still reproduces on OSX for me, even with the recommendation above.

          Show
          tpeters Teresa Peters added a comment - This still reproduces on OSX for me, even with the recommendation above.

            People

            Assignee:
            dblock Daniel Doubrovkine
            Reporter:
            dblock Daniel Doubrovkine
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated: