Failed to serialize org.jenkinsci.plugins.workflow.actions.ErrorAction when declaring classes in csp-global-lib

1,718 views
Skip to first unread message

Kenneth Baltrinic

unread,
Dec 15, 2014, 5:30:59 PM12/15/14
to jenkins...@googlegroups.com
I have a basic workflow script that is performing some validation on a chef cookbook before publishing it.    Most of the script code is in the csp-global-lib library because I am ultimately going to be validating a lot of cookbooks.

my workflow-lib repo looks like this:

src
 +- chef
    +- Cookbook.groovy

where Cookbook.groovy contains:

package chef;

def validate() {
    sh 'berks install'
    sh 'knife cookbook test'
    sh 'foodcritic .'
    sh 'kitchen converge'
    sh 'kitchen verify all'
    sh 'kitchen destroy'
}

def publish() {
    sh 'berks upload'
}

I have separate publish and validate functions because some workflows will only want to validate.

With the above, the following workflow script works fine:

cookbook = new chef.Cookbook()
cookbook.validate()
cookbook.publish()

However I want to introduce an instance variable to track that validation succeeded before publish is called (i.e. disallow publishing unvalidated cookbooks).

So I tried to update Cookbook.groovy to this:

package chef;

class Cookbook {

    def _validated = false

    def validate() {
        sh 'berks install'
        sh 'knife cookbook test'
        sh 'foodcritic .'
        sh 'kitchen converge'
        sh 'kitchen verify all'
        sh 'kitchen destroy'

        _validated = true
    }

    def publish() {

        if(!_validated) throw new Exception('Only validated cookbooks may be published.')

        sh 'berks upload'
    }
}

This results in the following error which appears to happen prior to any of the above groovy code being executed.   I have played with various ideas, like just declaring def _validate and not wrapping it all in an actual class.  Groovy doesn't like that understandably.  I also tried returning an instance of the class from the script, not naming the class the same as the script name, etc.  No luck.  Any ideas?

java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag#actions for class org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
	at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
	at hudson.XmlFile.write(XmlFile.java:178)
	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:106)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:640)
	at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:254)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.persist(FlowNode.java:241)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:217)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:208)
	at java.util.AbstractList.add(AbstractList.java:108)
	at hudson.model.Actionable.addAction(Actionable.java:122)
	at org.jenkinsci.plugins.workflow.cps.FlowHead.markIfFail(FlowHead.java:132)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:162)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:98)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)
	at WorkflowScript.run(WorkflowScript:14)
	at Unknown.Unknown(Unknown)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:69)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:100)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:76)
	at sun.reflect.GeneratedMethodAccessor334.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:262)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:70)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:174)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:172)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:111)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.actions.ErrorAction#error for class org.jenkinsci.plugins.workflow.actions.ErrorAction
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
	at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
	at hudson.XmlFile.write(XmlFile.java:178)
	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:106)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:640)
	at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:254)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.persist(FlowNode.java:241)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:217)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:208)
	at java.util.AbstractList.add(AbstractList.java:108)
	at hudson.model.Actionable.addAction(Actionable.java:122)
	at org.jenkinsci.plugins.workflow.cps.FlowHead.markIfFail(FlowHead.java:132)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:162)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:98)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)
	... 24 more
Caused by: java.lang.RuntimeException: Failed to serialize org.codehaus.groovy.control.MultipleCompilationErrorsException#collector for class org.codehaus.groovy.control.MultipleCompilationErrorsException
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.converters.extended.ThrowableConverter.marshal(ThrowableConverter.java:62)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 67 more
Caused by: java.lang.RuntimeException: Failed to serialize org.codehaus.groovy.control.ErrorCollector#errors for class org.codehaus.groovy.control.ErrorCollector
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 77 more
Caused by: java.lang.RuntimeException: Failed to serialize org.codehaus.groovy.control.messages.SimpleMessage#owner for class org.codehaus.groovy.control.messages.SimpleMessage
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 86 more
Caused by: java.lang.RuntimeException: Failed to serialize org.codehaus.groovy.control.ProcessingUnit#configuration for class org.codehaus.groovy.control.CompilationUnit
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 101 more
Caused by: java.lang.RuntimeException: Failed to serialize org.codehaus.groovy.control.CompilerConfiguration#compilationCustomizers for class org.codehaus.groovy.control.CompilerConfiguration
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 110 more
Caused by: java.lang.RuntimeException: Failed to serialize com.cloudbees.groovy.cps.CpsTransformer#sourceUnit for class com.cloudbees.groovy.cps.CpsTransformer
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 119 more
Caused by: java.lang.RuntimeException: Failed to serialize org.codehaus.groovy.control.ProcessingUnit#classLoader for class org.codehaus.groovy.control.SourceUnit
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 134 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.ClassLoader#parent for class groovy.lang.GroovyClassLoader
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 143 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.ClassLoader#parent for class org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxResolvingClassLoader
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 152 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.ClassLoader#parent for class hudson.PluginManager$UberClassLoader
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 161 more
Caused by: java.lang.RuntimeException: Failed to serialize org.eclipse.jetty.webapp.WebAppClassLoader#_context for class org.eclipse.jetty.webapp.WebAppClassLoader
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 170 more
Caused by: java.lang.RuntimeException: Failed to serialize org.eclipse.jetty.server.handler.AbstractHandler#_server for class winstone.HostConfiguration$1
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 179 more
Caused by: java.lang.RuntimeException: Failed to serialize org.eclipse.jetty.util.component.AggregateLifeCycle#_beans for class org.eclipse.jetty.server.Server
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 188 more
Caused by: java.lang.RuntimeException: Failed to serialize org.eclipse.jetty.util.component.AggregateLifeCycle$Bean#_bean for class org.eclipse.jetty.util.component.AggregateLifeCycle$Bean
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 197 more
Caused by: java.lang.RuntimeException: Failed to serialize org.eclipse.jetty.util.thread.ExecutorThreadPool#_executor for class org.eclipse.jetty.util.thread.ExecutorThreadPool
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 212 more
Caused by: java.lang.RuntimeException: Failed to serialize winstone.BoundedExecutorService#base for class winstone.BoundedExecutorService
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 221 more
Caused by: java.lang.RuntimeException: Failed to serialize java.util.concurrent.ThreadPoolExecutor#workers for class java.util.concurrent.ThreadPoolExecutor
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 230 more
Caused by: java.lang.RuntimeException: Failed to serialize java.util.concurrent.ThreadPoolExecutor$Worker#thread for class java.util.concurrent.ThreadPoolExecutor$Worker
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 239 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.Thread#group for class java.lang.Thread
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 254 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.ThreadGroup#threads for class java.lang.ThreadGroup
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 263 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.Thread#target for class java.lang.Thread
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 272 more
Caused by: java.lang.RuntimeException: Failed to serialize java.util.concurrent.ThreadPoolExecutor$Worker#this$0 for class java.util.concurrent.ThreadPoolExecutor$Worker
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 287 more
Caused by: java.lang.RuntimeException: Failed to serialize java.util.concurrent.ThreadPoolExecutor#workQueue for class java.util.concurrent.ScheduledThreadPoolExecutor
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 296 more
Caused by: java.lang.RuntimeException: Failed to serialize java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue#queue for class java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 305 more
Caused by: java.lang.RuntimeException: Failed to serialize java.util.concurrent.FutureTask#callable for class java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 314 more
Caused by: java.lang.RuntimeException: Failed to serialize java.util.concurrent.Executors$RunnableAdapter#task for class java.util.concurrent.Executors$RunnableAdapter
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 329 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.slaves.ComputerRetentionWork#nextCheck for class hudson.slaves.ComputerRetentionWork
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 338 more
Caused by: java.lang.RuntimeException: Failed to serialize java.util.WeakHashMap#table for class java.util.WeakHashMap
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 347 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.ref.Reference#referent for class java.util.WeakHashMap$Entry
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 356 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.model.Computer#workspaceList for class hudson.slaves.SlaveComputer
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 371 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.slaves.WorkspaceList#inUse for class hudson.slaves.WorkspaceList
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:214)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 380 more
Caused by: com.thoughtworks.xstream.converters.ConversionException: Could not call hudson.FilePath.writeObject() : Can't send a remote FilePath to a different remote channel
---- Debugging information ----
message             : Could not call hudson.FilePath.writeObject()
cause-exception     : java.lang.IllegalStateException
cause-message       : Can't send a remote FilePath to a different remote channel
-------------------------------
	at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callWriteObject(SerializationMethodInvoker.java:141)
	at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:259)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:83)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:78)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:223)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
	... 389 more
Caused by: java.lang.IllegalStateException: Can't send a remote FilePath to a different remote channel
	at hudson.FilePath.writeObject(FilePath.java:2628)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callWriteObject(SerializationMethodInvoker.java:135)
	... 402 more

Kohsuke Kawaguchi

unread,
Dec 16, 2014, 10:08:54 PM12/16/14
to jenkins...@googlegroups.com
The exception here is that it fails to persist ErrorAction with flow because ErrorAction.error refers to MultipleCompilationErrorsException, which in turn refers to ErrorCollector that sucks in CompilerConfiguration, which has references to all sorts of not-so-kosher objects.

In one sense, this all happens because you have a error in your groovy code that causes the groovy compilation to fail (probably your chef/Cookbook.groovy?) You fix that, and you won't see this problem.

I've committed a fix toward 1.2 to resolve this (5264f9275499c2ddb3ffc861d19e63bf61cde02b)

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e0787834-9070-4ac8-8f6c-187bafd9f343%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Kohsuke Kawaguchi

Jesse Glick

unread,
Dec 17, 2014, 1:10:38 PM12/17/14
to jenkins...@googlegroups.com
With that change I get an error

> No signature of method: chef.Cookbook.sh() is applicable for argument types…

meaning that the DSL methods are not accessible from your class. That is because when you define a standalone class, it has no access to the main ‘groovy.lang.Script’, on which DSL methods (and some miscellaneous stuff like ‘env’) are defined.

If I delete the ‘class Cookbook {}’ wrapper then it works fine—once I wrap the ‘sh’ sequence of both functions in ‘node {}’.

Basically, you did not need to rewrite the class structure to add the ‘_validated’ variable.

Kenneth Baltrinic

unread,
Dec 21, 2014, 4:27:11 AM12/21/14
to jenkins...@googlegroups.com
Kahsuke, The fast turnaround on the fix is much appreciated.

Jesse, Thanks for pursuing this even further.  I sat this aside to work on some other aspects of the project and oddly enough, just before checking back in on this thread this evening, I ran smack into the method not available problem on another piece of code where again I was trying to call node() in this case from within a formally declared class.  Which leads me to a follow-on problem:

First let me say that I am a long time coder but very new to groovy (learning it just to be able to use this workflow stuff) so I completely get why I can't call these methods from within a class now that I see the error.  But I have  a few questions that may be more properly groovy questions but I am a little unclear where groovy leaves of and workflow picks up here so I hope you will humor me.

I presume that when using scripts as classes, each class is basically a singleton with a lifespan equalling that of the execution of the workflow, with the caveat that all classes get serialized by Jenkins-workflow's state-saving mechanism that allows for resuming inflight workflows as well as allows for the state to be created/managed on the master node yet replicated to slave nodes for execution.  I am curious if there is any documentation around the implications and limitation that this need to be serializable places on classes.  For example, in my most recent effort, realizing that the node() method was not available, I tried to pass "this" into the class in order to try calling _this.node().  That got me a serialization error right quick, which makes perfect sense. What else might one do that would cause a class/script to not be serializable?

Which gets me back to my current dilemma.  Again this may be more of a groovy question but at present, I am again trying to use a formally declared class within a script so that I can subclass it and override certain methods as per the Template design pattern.  

My original code looked like this:

file Job.groovy:

public start(nodeType, stashProject, stashRepo) {

    node(nodeType) {

    checkout changelog: true, poll: true, scm: [
        $class: 'GitSCM',
        branches: [[name: '*/master']],
        doGenerateSubmoduleConfigurations: false,
        submoduleCfg: [],
        userRemoteConfigs: [[
            credentialsId: 'c39766d4-52c3-42ed-a1f0-fdfd3491a545',
            url: "ssh://git@stash:7999/${stashProject}/${stashRepo}.git"
        ]]
    ]

    load './build.groovy'
}

But now I am trying to do this: 


class Job {

    def _nodeType, _stashProject, _stashRepo

    public Job(nodeType, stashProject, stashRepo){
        _nodeType = nodeType
        _stashProject = stashProject
        _stashRepo = stashRepo
    }

    public start() {

        node(_nodeType) {

            beforeCheckout()

            checkout changelog: true, poll: true, scm: [
                $class: 'GitSCM',
                branches: [[name: '*/master']],
                doGenerateSubmoduleConfigurations: false,
                submoduleCfg: [],
                userRemoteConfigs: [[
                    credentialsId: 'c39766d4-52c3-42ed-a1f0-fdfd3491a545',
                    url: "ssh://git@stash:7999/${_stashProject}/${_stashRepo}.git"
                ]]
            ]

            afterCheckout()

            load './build.groovy'

            afterRun()
        }
    }

    def beforeCheckout(){
        //Virtual method
    }

    def afterCheckout(){
        //Virtual method
    }

    def afterRun(){
        //Virtual method
    }
}

The immediate impetus for this, is the need to conditionally do some customization of the .kitchen.yml file in the afterCheckout() method of my subclass depending on what nodeType it is running on (vagrant vs docker).

Perhaps I am trying to do things too much in my traditional OO GOF design patterns way of thinking about polymorphism.  So if there is a better approach to trying to solve this sort of problem in the context of Jenkins workflow and groovy, I am open too it.  

Bottom line though, my requirement is to create some standardized workflows, of which this Job.groovy and Cookbook.groovy are very simple examples, which are extensible but only at specific points.  

I hope that makes sense.  Any advice even if only to point me to some examples or docs to read would be greatly appreciated.  

--Regards,
Ken

Jesse Glick

unread,
Jan 7, 2015, 11:52:46 PM1/7/15
to jenkins...@googlegroups.com
On Saturday, December 20, 2014 11:27:11 PM UTC-5, Kenneth Baltrinic wrote:
all classes get serialized by Jenkins-workflow's state-saving mechanism that allows for resuming inflight workflows

Yes.
 
state to be created/managed on the master node yet replicated to slave nodes for execution

Workflows run entirely on the master, never slaves. Steps like ‘sh’ may fork processes on slaves and so on, but the Groovy itself remains local.

I am curious if there is any documentation around the implications and limitation that this need to be serializable places on classes.


Which gets me back to my current dilemma.  Again this may be more of a groovy question

I am afraid I did not follow what your actual question here was. (Kohsuke might be better placed to answer it anyway.) 
Reply all
Reply to author
Forward
0 new messages