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

junit test execution using ssh launcher fails with NoSuchMethodError

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • core
    • None
    • Linux

      I have a simple junit test using SSHLauncher to run on a slave node attached via SSH:

      public void testSshNode() throws Exception

      { String hostname = "localhost"; String username = System.getProperty("user.name"); SSHLauncher launcher = new SSHLauncher( /*host=*/hostname, /*port=*/22, /*username=*/username, /*password=*/"", /*privatekey=*/System.getProperty("user.home")+"/.ssh/arti-key", /*jvmOptions=*/""); DumbSlave node = new DumbSlave( /*name=*/hostname, /*nodeDescription=*/"created by job-executor", /*remoteFS=*/"/nobackup/"+username+"/arti/slaves/"+InetAddress.getLocalHost().getCanonicalHostName(), /*numExecutors=*/"4", // TODO We should not hardcode numExecutors here. /*mode=*/Node.Mode.NORMAL, /*labelString=*/hostname, /*launcher=*/launcher, /*retentionStrategy=*/RetentionStrategy.NOOP, /*nodeProperties=*/Collections.EMPTY_LIST); hudson.addNode(node); FreeStyleProject job = hudson.createProject(FreeStyleProject.class,"testjob"); DescribableList<Builder,Descriptor<Builder>> builders = job.getBuildersList(); builders.clear(); builders.add(new Shell("date >>/tmp/testSshNode.out")); job.setAssignedNode(node); job.scheduleBuild(new UserCause()); waitUntilNoActivity(); assertTrue(true); }

      It fails with this stacktrace:

      SEVERE: I/O error in channel localhost
      java.io.IOException: Unexpected termination of the channel
      at hudson.remoting.Channel$ReaderThread.run(Channel.java:953)
      Caused by: java.io.EOFException
      at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2554)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at hudson.remoting.Channel$ReaderThread.run(Channel.java:947)
      Jan 10, 2011 1:21:26 PM hudson.PluginWrapper stop
      INFO: Stopping cvs
      Jan 10, 2011 1:21:26 PM hudson.PluginWrapper stop
      INFO: Stopping maven-plugin
      Exception in thread "Channel reader thread: localhost" java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.<init>(I[B)V
      at org.apache.commons.codec.binary.Base64OutputStream.<init>(Base64OutputStream.java:97)
      at hudson.console.ConsoleNote.encodeToBytes(ConsoleNote.java:178)
      at hudson.console.ConsoleNote.encodeTo(ConsoleNote.java:156)
      at hudson.util.StreamTaskListener.annotate(StreamTaskListener.java:157)
      at hudson.util.StreamTaskListener._error(StreamTaskListener.java:132)
      at hudson.util.StreamTaskListener.error(StreamTaskListener.java:141)
      at hudson.plugins.sshslaves.SSHLauncher.afterDisconnect(SSHLauncher.java:599)
      at hudson.slaves.SlaveComputer$2.onClosed(SlaveComputer.java:305)
      at hudson.remoting.Channel.terminate(Channel.java:695)
      at hudson.remoting.Channel$ReaderThread.run(Channel.java:971)
      Jan 10, 2011 1:21:26 PM hudson.model.Hudson cleanUp
      WARNING: Failed to shut down properly
      java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.<init>(I[B)V
      at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
      at java.util.concurrent.FutureTask.get(FutureTask.java:91)
      at hudson.model.Hudson.cleanUp(Hudson.java:2300)
      at org.jvnet.hudson.test.HudsonTestCase.tearDown(HudsonTestCase.java:303)
      at junit.framework.TestCase.runBare(TestCase.java:140)
      at org.jvnet.hudson.test.HudsonTestCase.runBare(HudsonTestCase.java:224)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:124)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
      at $Proxy0.invoke(Unknown Source)
      at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
      at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
      Caused by: java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.<init>(I[B)V
      at org.apache.commons.codec.binary.Base64OutputStream.<init>(Base64OutputStream.java:97)
      at hudson.console.ConsoleNote.encodeToBytes(ConsoleNote.java:178)
      at hudson.console.ConsoleNote.encodeTo(ConsoleNote.java:156)
      at hudson.util.StreamTaskListener.annotate(StreamTaskListener.java:157)
      at hudson.util.StreamTaskListener._error(StreamTaskListener.java:132)
      at hudson.util.StreamTaskListener.error(StreamTaskListener.java:141)
      at hudson.plugins.sshslaves.SSHLauncher.afterDisconnect(SSHLauncher.java:599)
      at hudson.slaves.SlaveComputer$4.run(SlaveComputer.java:399)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)

      Full log attached.

            Unassigned Unassigned
            nlgu5kq4x6yl nlgu5kq4x6yl
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: