java.io.NotSerializableException: groovy.lang.MapWithDefault

Jenkins JIRA | Bahram Parsapour | 3 months ago
  1. 0

    Take the code snippet below to reproduce the failing build. {code} @NonCPS static def createMapWithDefault() { return [:].withDefault { [] } } def defaultMap= createMapWithDefault() echo "defaultMap: ${defaultMap}" node('default') { stage('checkout') { checkout scm } } {code} Console Output shows: {noformat} [Pipeline] echo defaultMap: [:] [Pipeline] node [Pipeline] End of Pipeline java.io.NotSerializableException: groovy.lang.MapWithDefault 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.HashMap.internalWriteEntries(HashMap.java:1777) at java.util.HashMap.writeObject(HashMap.java:1354) at sun.reflect.GeneratedMethodAccessor53.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.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.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.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.GeneratedMethodAccessor53.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:47) 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 locals in field capture in field def in field closures in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@3798ea97 Finished: FAILURE {noformat}

    Jenkins JIRA | 3 months ago | Bahram Parsapour
    java.io.NotSerializableException: groovy.lang.MapWithDefault
  2. 0

    [JIRA] (JENKINS-38186) java.io.NotSerializableException: groovy.lang.MapWithDefault

    Google Groups | 3 months ago | bahram.p...@dynatrace.com (JIRA)
    java.io.NotSerializableException: groovy.lang.MapWithDefault
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    [JIRA] [workflow-plugin] (JENKINS-27421) java.util.ArrayList$Itr is not Serializable

    Google Groups | 2 years ago | achi...@mercenarytechnology.com (JIRA)
    java.io.NotSerializableException: groovy.json.JsonSlurper
  5. 0

    I have 2 Swarm Nodes running. This is my workflow script. def tasks = [:] for(node in Jenkins.instance.nodes){ def name = node.name tasks[name] = { node(name) { echo name } } } parallel tasks Error [Workflow] echo adding jenkins-swarm-client-cjww8-1ec8e67c [Workflow] echo adding jenkins-swarm-client-njiq5-8e4b034d [Workflow] Execute sub-workflows in parallel : Start [Workflow] [jenkins-swarm-client-cjww8-1ec8e67c] parallel {: Parallel branch: jenkins-swarm-client-cjww8-1ec8e67c [Workflow] [jenkins-swarm-client-njiq5-8e4b034d] parallel {: Parallel branch: jenkins-swarm-client-njiq5-8e4b034d [Workflow] } //parallel [Workflow] } //parallel [Workflow] End of Workflow java.io.NotSerializableException: hudson.plugins.swarm.SwarmSlave$1 at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860) 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.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.GeneratedMethodAccessor28.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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.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.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.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.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.GeneratedMethodAccessor28.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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:347) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:331) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:306) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:74) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:183) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:181) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47) 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 launcher in field locals in field parent in field capture in field def in field closures in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@f168afe Finished: FAILURE

    Jenkins JIRA | 1 year ago | Ming Fang
    java.io.NotSerializableException: hudson.plugins.swarm.SwarmSlave$1

  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

    groovy.lang.MapWithDefault

    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.HashMap.internalWriteEntries(HashMap.java:1777)
    3. java.util.HashMap.writeObject(HashMap.java:1354)
    4. sun.reflect.GeneratedMethodAccessor53.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.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)
    6. org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
    7. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
    8. org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
    9. org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
    10. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
    11. org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
    12. org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
    13. org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
    14. org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
    14 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
    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.GeneratedMethodAccessor53.invoke(Unknown Source)
    5. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    6. java.lang.reflect.Method.invoke(Method.java:498)
    6 frames
  11. JBoss Marshalling API
    SerializableClass.callWriteObject
    1. org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
    1 frame
  12. 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
  13. 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
  14. 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:47)
    8 frames
  15. Java RT
    FutureTask.run
    1. java.util.concurrent.FutureTask.run(FutureTask.java:266)
    1 frame
  16. Hudson :: Remoting Layer
    SingleLaneExecutorService$1.run
    1. hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
    1 frame
  17. jenkins.util
    ContextResettingExecutorService$1.run
    1. jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    1 frame
  18. 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