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

java.lang.ClassCastException/NPE in Remoting while executing Maven Builder

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • core, maven-plugin, remoting
    • Jenkins Build slave in linux RHEL os, Jenkins 1.518, JDK 7, Maven 3.0.3 etc.

      We are getting below exception in case of all the builds on JDK 7, Maven 3.0.3 even in case of successful build scenarion.

      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 45:36.641s
      [INFO] Finished at: Wed Dec 31 15:26:27 IST 2014
      [INFO] Final Memory: 226M/605M
      [INFO] ------------------------------------------------------------------------
      ERROR: Asynchronous execution failure
      java.util.concurrent.ExecutionException: java.lang.ClassCastException
      at hudson.remoting.Channel$3.adapt(Channel.java:784)
      at hudson.remoting.Channel$3.adapt(Channel.java:779)
      at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
      at hudson.maven.AbstractMavenBuilder.waitForAsynchronousExecutions(AbstractMavenBuilder.java:186)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:143)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:324)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.ClassCastException
      ERROR: Asynchronous execution failure
      java.util.concurrent.ExecutionException: java.lang.ClassCastException
      at hudson.remoting.Channel$3.adapt(Channel.java:784)
      at hudson.remoting.Channel$3.adapt(Channel.java:779)
      at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
      at hudson.maven.AbstractMavenBuilder.waitForAsynchronousExecutions(AbstractMavenBuilder.java:186)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:143)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:324)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.ClassCastException
      ERROR: Asynchronous execution failure

      Need help to know the fix of the same problem.

          [JENKINS-26257] java.lang.ClassCastException/NPE in Remoting while executing Maven Builder

          swapnil soor created issue -

          swapnil soor added a comment -

          ANY UPDATE ON THIS, THIS IS CAUSING RELEASE BUILD ERRORS......PLEASE PROVIDE THE SOLUTION. THANKS!

          swapnil soor added a comment - ANY UPDATE ON THIS, THIS IS CAUSING RELEASE BUILD ERRORS......PLEASE PROVIDE THE SOLUTION. THANKS!

          Daniel Beck added a comment -

          First off, ALL CAPS TEXT IS CONSIDERED YELLING so stop that. Besides, it's both more difficult to read and unprofessional, making you look like a 12 year old.

          Second, you should read and follow the advice of https://wiki.jenkins-ci.org/display/JENKINS/How+to+report+an+issue because this report doesn't contain nearly enough information to investigate further. In fact, the little information it contains is partially wrong (Flowdock Plugin and Plugin Usage Plugin have absolutely nothing to do with your problem), which means it's your own fault nobody cares. You addressed the report to completely wrong components.

          Third, everyone handling these reports is an unpaid volunteer working in their spare time and under no obligation to do anything. This, combined with the previous two points means that it's unlikely you'll get help here.

          There are companies providing paid support for Jenkins (e.g. CloudBees when buying a Jenkins Enterprise subscription). Consider going that route to get guaranteed response times.

          Daniel Beck added a comment - First off, ALL CAPS TEXT IS CONSIDERED YELLING so stop that. Besides, it's both more difficult to read and unprofessional, making you look like a 12 year old. Second, you should read and follow the advice of https://wiki.jenkins-ci.org/display/JENKINS/How+to+report+an+issue because this report doesn't contain nearly enough information to investigate further. In fact, the little information it contains is partially wrong (Flowdock Plugin and Plugin Usage Plugin have absolutely nothing to do with your problem), which means it's your own fault nobody cares. You addressed the report to completely wrong components. Third, everyone handling these reports is an unpaid volunteer working in their spare time and under no obligation to do anything. This, combined with the previous two points means that it's unlikely you'll get help here. There are companies providing paid support for Jenkins (e.g. CloudBees when buying a Jenkins Enterprise subscription). Consider going that route to get guaranteed response times.

          Oleg Nenashev added a comment -

          +1 regarding Daniel's comments

          Regarding the issue...
          Probably, it's a bug in remoting layer. Seems the provided stacktrace is incomplete, so it's impossible to find the real cause.

          The core is quite old (1.518), so as a first step I would recommend updating to the latest or latest LTS version.

          Oleg Nenashev added a comment - +1 regarding Daniel's comments Regarding the issue... Probably, it's a bug in remoting layer. Seems the provided stacktrace is incomplete, so it's impossible to find the real cause. The core is quite old (1.518), so as a first step I would recommend updating to the latest or latest LTS version.
          Oleg Nenashev made changes -
          Component/s New: core [ 15593 ]
          Component/s New: remoting [ 15489 ]
          Component/s Original: jenkins-flowdock [ 17564 ]
          Component/s Original: plugin-usage-plugin [ 19227 ]

          swapnil soor added a comment -

          Sorry for irritation caused due to cap letter , I had no intentions to do so. I do understand being this a free service nobody is obliged to provide guaranteed response. But most of the time I found good solutions by the experts here only.

          Anyways thanks for the response Daniel. I will change the component to core, thanks!

          @Oleg, Sorry the Jenkins Version Used is: 1.588, we had upgraded this recently. I have provided only the error snippet, may be I might have missed in our setup which is leading to this error, any clue/pointer in debuging would be helpful.

          Since it was throwing the exception in hudson packages, I thought its a coding bug. On jenkins console I am getting below exception though the build is successful, right after Maven Build Success message.
          Error is repetitive hence didn't posted the whole thread:

          [INFO] Final Memory: 245M/562M
          [INFO] ------------------------------------------------------------------------
          ERROR: Asynchronous execution failure
          java.util.concurrent.ExecutionException: java.lang.ClassCastException
          at hudson.remoting.Channel$3.adapt(Channel.java:784)
          at hudson.remoting.Channel$3.adapt(Channel.java:779)
          at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
          at hudson.maven.AbstractMavenBuilder.waitForAsynchronousExecutions(AbstractMavenBuilder.java:186)
          at hudson.maven.Maven3Builder.call(Maven3Builder.java:143)
          at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
          at hudson.remoting.UserRequest.perform(UserRequest.java:121)
          at hudson.remoting.UserRequest.perform(UserRequest.java:49)
          at hudson.remoting.Request$2.run(Request.java:324)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:701)
          Caused by: java.lang.ClassCastException
          line no..21
          ..
          ..
          line no..2020
          ERROR: Asynchronous execution failure
          java.util.concurrent.ExecutionException: java.lang.ClassCastException
          at hudson.remoting.Channel$3.adapt(Channel.java:784)
          at hudson.remoting.Channel$3.adapt(Channel.java:779)
          at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
          at hudson.maven.AbstractMavenBuilder.waitForAsynchronousExecutions(AbstractMavenBuilder.java:186)
          at hudson.maven.Maven3Builder.call(Maven3Builder.java:143)
          at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
          at hudson.remoting.UserRequest.perform(UserRequest.java:121)
          at hudson.remoting.UserRequest.perform(UserRequest.java:49)
          at hudson.remoting.Request$2.run(Request.java:324)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:701)
          Caused by: java.lang.ClassCastException
          at .(Unknown Source)
          at ......remote call to channel(Native Method)
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
          at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
          at hudson.remoting.Channel$3.adapt(Channel.java:782)
          ... 14 more
          ERROR: Asynchronous execution failure
          java.util.concurrent.ExecutionException: java.lang.ClassCastException
          at hudson.remoting.Channel$3.adapt(Channel.java:784)
          at hudson.remoting.Channel$3.adapt(Channel.java:779)
          at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
          at hudson.maven.AbstractMavenBuilder.waitForAsynchronousExecutions(AbstractMavenBuilder.java:186)
          at hudson.maven.Maven3Builder.call(Maven3Builder.java:143)
          at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
          at hudson.remoting.UserRequest.perform(UserRequest.java:121)
          at hudson.remoting.UserRequest.perform(UserRequest.java:49)
          at hudson.remoting.Request$2.run(Request.java:324)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:701)
          Caused by: java.lang.ClassCastException
          at .(Unknown Source)
          at ......remote call to channel(Native Method)
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
          at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
          at hudson.remoting.Channel$3.adapt(Channel.java:782)
          ... 14 more
          [JENKINS] Archiving /home/build/slave/workspace/

          Please any step I need to do, to find out the issue. Thanks in advance!

          Regards,
          Swapnil

          swapnil soor added a comment - Sorry for irritation caused due to cap letter , I had no intentions to do so. I do understand being this a free service nobody is obliged to provide guaranteed response. But most of the time I found good solutions by the experts here only. Anyways thanks for the response Daniel. I will change the component to core, thanks! @Oleg, Sorry the Jenkins Version Used is: 1.588, we had upgraded this recently. I have provided only the error snippet, may be I might have missed in our setup which is leading to this error, any clue/pointer in debuging would be helpful. Since it was throwing the exception in hudson packages, I thought its a coding bug. On jenkins console I am getting below exception though the build is successful, right after Maven Build Success message. Error is repetitive hence didn't posted the whole thread: [INFO] Final Memory: 245M/562M [INFO] ------------------------------------------------------------------------ ERROR: Asynchronous execution failure java.util.concurrent.ExecutionException: java.lang.ClassCastException at hudson.remoting.Channel$3.adapt(Channel.java:784) at hudson.remoting.Channel$3.adapt(Channel.java:779) at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55) at hudson.maven.AbstractMavenBuilder.waitForAsynchronousExecutions(AbstractMavenBuilder.java:186) at hudson.maven.Maven3Builder.call(Maven3Builder.java:143) at hudson.maven.Maven3Builder.call(Maven3Builder.java:71) at hudson.remoting.UserRequest.perform(UserRequest.java:121) at hudson.remoting.UserRequest.perform(UserRequest.java:49) at hudson.remoting.Request$2.run(Request.java:324) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:701) Caused by: java.lang.ClassCastException line no..21 .. .. line no..2020 ERROR: Asynchronous execution failure java.util.concurrent.ExecutionException: java.lang.ClassCastException at hudson.remoting.Channel$3.adapt(Channel.java:784) at hudson.remoting.Channel$3.adapt(Channel.java:779) at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55) at hudson.maven.AbstractMavenBuilder.waitForAsynchronousExecutions(AbstractMavenBuilder.java:186) at hudson.maven.Maven3Builder.call(Maven3Builder.java:143) at hudson.maven.Maven3Builder.call(Maven3Builder.java:71) at hudson.remoting.UserRequest.perform(UserRequest.java:121) at hudson.remoting.UserRequest.perform(UserRequest.java:49) at hudson.remoting.Request$2.run(Request.java:324) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:701) Caused by: java.lang.ClassCastException at .(Unknown Source) at ......remote call to channel(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356) at hudson.remoting.UserResponse.retrieve(UserRequest.java:221) at hudson.remoting.Channel$3.adapt(Channel.java:782) ... 14 more ERROR: Asynchronous execution failure java.util.concurrent.ExecutionException: java.lang.ClassCastException at hudson.remoting.Channel$3.adapt(Channel.java:784) at hudson.remoting.Channel$3.adapt(Channel.java:779) at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55) at hudson.maven.AbstractMavenBuilder.waitForAsynchronousExecutions(AbstractMavenBuilder.java:186) at hudson.maven.Maven3Builder.call(Maven3Builder.java:143) at hudson.maven.Maven3Builder.call(Maven3Builder.java:71) at hudson.remoting.UserRequest.perform(UserRequest.java:121) at hudson.remoting.UserRequest.perform(UserRequest.java:49) at hudson.remoting.Request$2.run(Request.java:324) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:701) Caused by: java.lang.ClassCastException at .(Unknown Source) at ......remote call to channel(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356) at hudson.remoting.UserResponse.retrieve(UserRequest.java:221) at hudson.remoting.Channel$3.adapt(Channel.java:782) ... 14 more [JENKINS] Archiving /home/build/slave/workspace/ Please any step I need to do, to find out the issue. Thanks in advance! Regards, Swapnil

          Daniel Beck added a comment -

          Make sure the slave.jar on the slaves is up to date. VersionColumn Plugin can help you with that. SSH Slaves take care of this automatically, but if you're launching using a different mechanism, that may be a problem.

          Daniel Beck added a comment - Make sure the slave.jar on the slaves is up to date. VersionColumn Plugin can help you with that. SSH Slaves take care of this automatically, but if you're launching using a different mechanism, that may be a problem.

          swapnil soor added a comment -

          Hi Daniel,

          Thanks for the pointer, I have installed the VersionColumn Plugin, and its not complaining for any of the slave jars, so I believe that's not the issue. Moreover, when I am trying a release build, I am executing it on master server only where Jenkins is installed and not using any slave.

          When I did further analysis between various build jobs I have, found a pattern that its causing this exception only for the job which is having a heavy maven build in terms of modules, which takes almost an hour for us to get all the modules built, may be it has some relation with timing or some threading issue in the core part of code which is leading to this error. Just wanted to share my analysis, might give you some clue to diagnose the problem. Thanks!

          Regards,
          Swapnil

          swapnil soor added a comment - Hi Daniel, Thanks for the pointer, I have installed the VersionColumn Plugin, and its not complaining for any of the slave jars, so I believe that's not the issue. Moreover, when I am trying a release build, I am executing it on master server only where Jenkins is installed and not using any slave. When I did further analysis between various build jobs I have, found a pattern that its causing this exception only for the job which is having a heavy maven build in terms of modules, which takes almost an hour for us to get all the modules built, may be it has some relation with timing or some threading issue in the core part of code which is leading to this error. Just wanted to share my analysis, might give you some clue to diagnose the problem. Thanks! Regards, Swapnil

          Madhu Chandar Malempati added a comment - - edited

          Hi Swapnil,

          I am now facing the same exception and couldn't able to find out the root cause. I can see that it's a long time back you faced this exeception. But can you please help me resolve this issue if you have any track of it.
          Slave.jar as mentioned by daniel seems to be fine in my case

          Madhu Chandar Malempati added a comment - - edited Hi Swapnil, I am now facing the same exception and couldn't able to find out the root cause. I can see that it's a long time back you faced this exeception. But can you please help me resolve this issue if you have any track of it. Slave.jar as mentioned by daniel seems to be fine in my case

          Oleg Nenashev added a comment -

          ClassCastException is being suppressed in the logs.
          It would be great if somebody adds "-XX:-OmitStackTraceInFastThrow" flag to the JVM instance and reproduces the issue. In such case we would have a log entry with more info.

          Oleg Nenashev added a comment - ClassCastException is being suppressed in the logs. It would be great if somebody adds "-XX:-OmitStackTraceInFastThrow" flag to the JVM instance and reproduces the issue. In such case we would have a log entry with more info.

            jthompson Jeff Thompson
            jenkinsswapnil swapnil soor
            Votes:
            9 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: