java.io.NotSerializableException: hudson.matrix.MatrixProject

Jenkins JIRA | Estrada Matthieu | 2 months ago
  1. 0

    [JIRA] (JENKINS-38571) Can't get Axes result in pipeline

    Google Groups | 2 months ago | ttam...@gmail.com (JIRA)
    java.io.NotSerializableException: hudson.matrix.MatrixProject
  2. 0

    Hello, When I attempt to access some value or object of Matrix Job in Pipeline script, I often had the following error: {code:java} java.io.NotSerializableException: hudson.matrix.MatrixRun {code} Sometimes I've solved this problem (cause my code is not good or not correctly formed) or bypass by other ways. But in this case, I can't found a solution. here is my pipeline code : {code:java} node { def job = jenkins.model.Jenkins.instance.getItem("Corealpi_Core") // It seems problem comes here def axes = job.getLastBuild().getRuns() for(int i = 0; i < axes.size(); i++) { println("${axes[i].getResult()}") } } {code} If I execute this in script console, that's working fine. Here is the full log : {code:java} java.io.NotSerializableException: hudson.matrix.MatrixProject at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860) at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65) at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56) at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50) at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) at java.util.LinkedHashMap.internalWriteEntries(LinkedHashMap.java:333) at java.util.HashMap.writeObject(HashMap.java:1354) at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967) at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854) at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65) at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56) at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50) at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) at com.cloudbees.groovy.cps.SerializableScript.writeObject(SerializableScript.java:26) at sun.reflect.GeneratedMethodAccessor208.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967) at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854) at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967) at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854) at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65) at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56) at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50) at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) at java.util.HashMap.internalWriteEntries(HashMap.java:1777) at java.util.HashMap.writeObject(HashMap.java:1354) at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976) at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854) at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988) at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854) at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.writeObject(RiverWriter.java:132) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:429) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:408) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:356) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: an exception which occurred: in field delegate in field closures in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@779d2a23 Finished: FAILURE {code} Is there a workaround for this problem ? Or I make a mistake somewhere ?

    Jenkins JIRA | 2 months ago | Estrada Matthieu
    java.io.NotSerializableException: hudson.matrix.MatrixProject
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Pipeline Groovy Madness

    Google Groups | 2 months ago | Jonathan Hodgson
    java.io.NotSerializableException: java.util.LinkedHashMap$Entry

  1. davidvanlaatum 14 times, last 6 months ago
6 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.NotSerializableException

    hudson.matrix.MatrixProject

    at org.jboss.marshalling.river.RiverMarshaller.doWriteObject()
  2. JBoss Marshalling River
    BlockMarshaller.writeObject
    1. org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
    2. org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
    3. org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
    3 frames
  3. JBoss Marshalling API
    MarshallerObjectOutputStream.writeObjectOverride
    1. org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
    1 frame
  4. JBoss Marshalling River
    RiverObjectOutputStream.writeObjectOverride
    1. org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
    1 frame
  5. Java RT
    Method.invoke
    1. java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
    2. java.util.LinkedHashMap.internalWriteEntries(LinkedHashMap.java:333)
    3. java.util.HashMap.writeObject(HashMap.java:1354)
    4. sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
    5. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    6. java.lang.reflect.Method.invoke(Method.java:498)
    6 frames
  6. JBoss Marshalling API
    SerializableClass.callWriteObject
    1. org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
    1 frame
  7. JBoss Marshalling River
    BlockMarshaller.writeObject
    1. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)
    2. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
    3. org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
    4. org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
    5. org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
    5 frames
  8. JBoss Marshalling API
    MarshallerObjectOutputStream.writeObjectOverride
    1. org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
    1 frame
  9. JBoss Marshalling River
    RiverObjectOutputStream.writeObjectOverride
    1. org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
    1 frame
  10. Java RT
    ObjectOutputStream.writeObject
    1. java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
    1 frame
  11. com.cloudbees.groovy
    SerializableScript.writeObject
    1. com.cloudbees.groovy.cps.SerializableScript.writeObject(SerializableScript.java:26)
    1 frame
  12. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor208.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    3. java.lang.reflect.Method.invoke(Method.java:498)
    3 frames
  13. JBoss Marshalling API
    SerializableClass.callWriteObject
    1. org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
    1 frame
  14. JBoss Marshalling River
    BlockMarshaller.writeObject
    1. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)
    2. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
    3. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
    4. org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
    5. org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
    6. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
    7. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
    8. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
    9. org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
    10. org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
    11. org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
    11 frames
  15. JBoss Marshalling API
    MarshallerObjectOutputStream.writeObjectOverride
    1. org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
    1 frame
  16. JBoss Marshalling River
    RiverObjectOutputStream.writeObjectOverride
    1. org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
    1 frame
  17. Java RT
    Method.invoke
    1. java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
    2. java.util.HashMap.internalWriteEntries(HashMap.java:1777)
    3. java.util.HashMap.writeObject(HashMap.java:1354)
    4. sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
    5. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    6. java.lang.reflect.Method.invoke(Method.java:498)
    6 frames
  18. JBoss Marshalling API
    SerializableClass.callWriteObject
    1. org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
    1 frame
  19. JBoss Marshalling River
    RiverMarshaller.doWriteObject
    1. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)
    2. org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
    3. org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
    4. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
    5. org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
    5 frames
  20. JBoss Marshalling API
    AbstractMarshaller.writeObject
    1. org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58)
    2. org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111)
    2 frames
  21. org.jenkinsci.plugins
    CpsVmExecutorService$2.call
    1. org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.writeObject(RiverWriter.java:132)
    2. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:429)
    3. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:408)
    4. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:356)
    5. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78)
    6. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236)
    7. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224)
    8. org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)
    8 frames
  22. Java RT
    FutureTask.run
    1. java.util.concurrent.FutureTask.run(FutureTask.java:266)
    1 frame
  23. Hudson :: Remoting Layer
    SingleLaneExecutorService$1.run
    1. hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
    1 frame
  24. jenkins.util
    ContextResettingExecutorService$1.run
    1. jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    1 frame
  25. Java RT
    Thread.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
    3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    5. java.lang.Thread.run(Thread.java:745)
    5 frames