java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • We frequently - but not usually - get build failures of the form: {code} See <http://deadlock.netbeans.org/hudson/job/push-core-main/20032/> ------------------------------------------ Started by timer Building remotely on Push-to-Silver-Node FATAL: cannot assign instance of hudson.model.StreamBuildListener to field hudson.plugins.mercurial.MercurialSCM$1.val$listener of type hudson.model.BuildListener in instance of hudson.plugins.mercurial.MercurialSCM$1 java.lang.ClassCastException: cannot assign instance of hudson.model.StreamBuildListener to field hudson.plugins.mercurial.MercurialSCM$1.val$listener of type hudson.model.BuildListener in instance of hudson.plugins.mercurial.MercurialSCM$1 at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2039) at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1212) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1952) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at hudson.remoting.UserRequest.deserialize(UserRequest.java:178) at hudson.remoting.UserRequest.perform(UserRequest.java:98) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:283) 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:662) {code} The job config in this case is {code:xml} <scm class="hudson.plugins.mercurial.MercurialSCM"> <installation>default Mercurial with caching</installation> <source>http://hg.netbeans.org/main-silver/</source> <modules></modules> <clean>false</clean> <forest>false</forest> <browser class="hudson.plugins.mercurial.browser.HgWeb"> <url>http://hg.netbeans.org/main-silver/</url> </browser> </scm> {code} but other jobs also fail as well. Possibly a problem with unserializable anonymous classes being passed around in remoting.
    via by Jesse Glick,
  • We frequently - but not usually - get build failures of the form: {code} See <http://deadlock.netbeans.org/hudson/job/push-core-main/20032/> ------------------------------------------ Started by timer Building remotely on Push-to-Silver-Node FATAL: cannot assign instance of hudson.model.StreamBuildListener to field hudson.plugins.mercurial.MercurialSCM$1.val$listener of type hudson.model.BuildListener in instance of hudson.plugins.mercurial.MercurialSCM$1 java.lang.ClassCastException: cannot assign instance of hudson.model.StreamBuildListener to field hudson.plugins.mercurial.MercurialSCM$1.val$listener of type hudson.model.BuildListener in instance of hudson.plugins.mercurial.MercurialSCM$1 at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2039) at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1212) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1952) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at hudson.remoting.UserRequest.deserialize(UserRequest.java:178) at hudson.remoting.UserRequest.perform(UserRequest.java:98) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:283) 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:662) {code} The job config in this case is {code:xml} <scm class="hudson.plugins.mercurial.MercurialSCM"> <installation>default Mercurial with caching</installation> <source>http://hg.netbeans.org/main-silver/</source> <modules></modules> <clean>false</clean> <forest>false</forest> <browser class="hudson.plugins.mercurial.browser.HgWeb"> <url>http://hg.netbeans.org/main-silver/</url> </browser> </scm> {code} but other jobs also fail as well. Possibly a problem with unserializable anonymous classes being passed around in remoting.
    via by Jesse Glick,
  • As you can see below, it doesn't show the call site information. {noformat} ERROR: Processing failed due to a bug in the code. Please report this to jenkins-users@googlegroups.com java.lang.ClassCastException: cannot assign instance of hudson.model.StreamBuildListener to field hudson.maven.MavenModuleSetBuild$PomParser.listener of type hudson.model.BuildListener in instance of hudson.maven.MavenModuleSetBuild$PomParser at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2056) at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1229) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368) at hudson.remoting.UserRequest.deserialize(UserRequest.java:178) at hudson.remoting.UserRequest.perform(UserRequest.java:98) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 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:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) {noformat}
    via by Kohsuke Kawaguchi,
  • ClassCastException during SCM polling
    via by jan.sievers,
  • As you can see below, it doesn't show the call site information. {noformat} ERROR: Processing failed due to a bug in the code. Please report this to jenkins-users@googlegroups.com java.lang.ClassCastException: cannot assign instance of hudson.model.StreamBuildListener to field hudson.maven.MavenModuleSetBuild$PomParser.listener of type hudson.model.BuildListener in instance of hudson.maven.MavenModuleSetBuild$PomParser at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2056) at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1229) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368) at hudson.remoting.UserRequest.deserialize(UserRequest.java:178) at hudson.remoting.UserRequest.perform(UserRequest.java:98) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 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:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) {noformat}
    via by Kohsuke Kawaguchi,
    • java.lang.ClassCastException: cannot assign instance of hudson.model.StreamBuildListener to field hudson.plugins.mercurial.MercurialSCM$1.val$listener of type hudson.model.BuildListener in instance of hudson.plugins.mercurial.MercurialSCM$1 at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2039) at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1212) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1952) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at hudson.remoting.UserRequest.deserialize(UserRequest.java:178) at hudson.remoting.UserRequest.perform(UserRequest.java:98) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:283) 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:662)

    Users with the same issue

    johnxfly
    54 times, last one,
    bpbhat77
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    14 more bugmates