java.io.NotSerializableException: java.util.HashMap$KeySet

Jenkins JIRA | Wilfried Goesgens | 5 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I'm using this script, which works properly on the groovy commandline interpreter: def testCaseSets = [ 'config.upgrade.authentication.authentication_parameters.arangobench': [ ""], 'dump.importing': ["", "--cluster true"], 'shell_server': ["", "--cluster true --testBuckets 4/1 ", "--cluster true --testBuckets 4/2 ", "--cluster true --testBuckets 4/3 ", "--cluster true --testBuckets 4/4 "], 'shell_server_aql': ["", "--cluster true --testBuckets 4/1 ", "--cluster true --testBuckets 4/2 ", "--cluster true --testBuckets 4/3 ", "--cluster true --testBuckets 4/4 "], 'arangosh': ["", "--cluster true --testBuckets 4/1 ", "--cluster true --testBuckets 4/2 ", "--cluster true --testBuckets 4/3 ", "--cluster true --testBuckets 4/4 "], ] print("getting keyset\n") testCaseNames = testCaseSets.keySet() print("done keyset is: ${testCaseNames}\n") m = testCaseNames.size() print("size: ${m}\n") int n = 0; for (int i = 0; i < m; i++) { print("in loop\n") def unitTestName = testCaseNames.getAt(i); print("unitTestName: ${unitTestName}\n") def thisTest = testCaseSets[unitTestName] print( "generating short name:\n") def shortName = unitTestName.take(12) print("generated short name: ${shortName}\n") } Using it in the jenkins pipeline script will make _testCaseSets.keySet()_ throw this ecxeption: [Pipeline] stage [Pipeline] { (cloning source) [Pipeline] echo getting keyset [Pipeline] echo done keyset is: [config.upgrade.authentication.authentication_parameters.arangobench, dump.importing, shell_server, shell_server_aql, arangosh] [Pipeline] echo size: 5 [Pipeline] } [Pipeline] // stage [Pipeline] End of Pipeline java.io.NotSerializableException: java.util.HashMap$KeySet 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:343) at java.util.HashMap.writeObject(HashMap.java:1129) at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271) ... Caused by: an exception which occurred: in field delegate in field closures in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@69005cb8

    Jenkins JIRA | 5 months ago | Wilfried Goesgens
    java.io.NotSerializableException: java.util.HashMap$KeySet
  2. 0

    [JIRA] (JENKINS-37396) java.io.NotSerializableException: groovy.sql.GroovyRowResult

    Google Groups | 6 months ago | likeanyothe...@gmail.com (JIRA)
    java.io.NotSerializableException: groovy.sql.GroovyRowResult
  3. 0

    Failing to iterate list with workflow

    Google Groups | 2 years ago | David Resnick
    java.io.NotSerializableException: java.util.ArrayList$Itr
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

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

    java.util.HashMap$KeySet

    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:343)
    2. java.util.HashMap.writeObject(HashMap.java:1129)
    3. sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
    4. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    5. java.lang.reflect.Method.invoke(Method.java:606)
    5 frames
  6. JBoss Marshalling API
    SerializableClass.callWriteObject
    1. org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
    1 frame