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

Google Groups | doth...@citadel.org (JIRA) | 3 months ago
  1. 0

    [JIRA] (JENKINS-38162) Groovy list keySet() method crashes

    Google Groups | 3 months ago | doth...@citadel.org (JIRA)
    java.io.NotSerializableException: java.util.HashMap$KeySet
  2. 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 | 3 months ago | Wilfried Goesgens
    java.io.NotSerializableException: java.util.HashMap$KeySet
  3. 0

    Failing to iterate list with workflow

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

    Automated exception search integrated into your IDE

  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

    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