提交 ad95f93a 编写于 作者: K Kohsuke Kawaguchi

fixed a persistence problem in Queue.

Queue.BlockedItem is not static, and so if items include this type, it ends up trying to persist the whole Queue instance, which will never work.
Sample stack trace below:

java.lang.RuntimeException: Failed to serialize hudson.model.Queue$BlockedItem#this$0 for class hudson.model.Queue$BlockedItem
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:55)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:98)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:38)
	at com.thoughtworks.xstream.XStream.marshal(XStream.java:840)
	at com.thoughtworks.xstream.XStream.marshal(XStream.java:829)
	at com.thoughtworks.xstream.XStream.toXML(XStream.java:804)
	at hudson.XmlFile.write(XmlFile.java:173)
	at hudson.model.Queue.save(Queue.java:349)
	at jenkins.model.Jenkins.cleanUp(Jenkins.java:2575)
	at org.jvnet.hudson.test.HudsonTestCase.tearDown(HudsonTestCase.java:381)
	at junit.framework.TestCase.runBare(TestCase.java:140)
	at org.jvnet.hudson.test.HudsonTestCase.runBare(HudsonTestCase.java:286)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at com.sun.maven.junit.LocalTestCaseRunner.runTests(LocalTestCaseRunner.java:142)
	at com.sun.maven.junit.LocalTestCaseRunner.runTestCase(LocalTestCaseRunner.java:62)
	at com.sun.maven.junit.LocalTestCaseRunner.runTestCase(LocalTestCaseRunner.java:58)
	at sun.reflect.GeneratedMethodAccessor352.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:274)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:255)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:215)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:270)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: Failed to serialize hudson.model.Queue#parked for class hudson.model.Queue
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 47 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.Thread#group for class hudson.model.Executor
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:57)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 55 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:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 68 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.Thread#threadLocals for class hudson.remoting.Channel$ReaderThread
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	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:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 76 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.ThreadLocal$ThreadLocalMap#table for class java.lang.ThreadLocal$ThreadLocalMap
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 89 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.ThreadLocal$ThreadLocalMap$Entry#value for class java.lang.ThreadLocal$ThreadLocalMap$Entry
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	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:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 97 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.remoting.Channel#executor for class hudson.remoting.Channel
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 110 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:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 118 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:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:55)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 126 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.Thread#threadLocals for class java.lang.Thread
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 139 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.ThreadLocal$ThreadLocalMap#table for class java.lang.ThreadLocal$ThreadLocalMap
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 147 more
Caused by: java.lang.RuntimeException: Failed to serialize java.lang.ref.Reference#referent for class java.lang.ThreadLocal$ThreadLocalMap$Entry
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	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:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 155 more
Caused by: java.lang.RuntimeException: Failed to serialize com.google.inject.internal.InjectorImpl$1#this$0 for class com.google.inject.internal.InjectorImpl$1
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 168 more
Caused by: java.lang.RuntimeException: Failed to serialize com.google.inject.internal.InjectorImpl#state for class com.google.inject.internal.InjectorImpl
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 176 more
Caused by: java.lang.RuntimeException: Failed to serialize com.google.inject.internal.InheritingState#explicitBindingsMutable for class com.google.inject.internal.InheritingState
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 184 more
Caused by: java.lang.RuntimeException: Failed to serialize com.google.inject.internal.BindingImpl#internalFactory for class com.google.inject.internal.ProviderInstanceBindingImpl
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:58)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 192 more
Caused by: java.lang.RuntimeException: Failed to serialize com.google.inject.internal.InternalFactoryToProviderAdapter#provider for class com.google.inject.internal.InternalFactoryToProviderAdapter
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 205 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.ExtensionFinder$GuiceFinder$4$1#val$base for class hudson.ExtensionFinder$GuiceFinder$4$1
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 213 more
Caused by: java.lang.RuntimeException: Failed to serialize com.google.inject.Scopes$1$1#val$creator for class com.google.inject.Scopes$1$1
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 221 more
Caused by: java.lang.RuntimeException: Failed to serialize com.google.inject.internal.ProviderToInternalFactoryAdapter#internalFactory for class com.google.inject.internal.ProviderToInternalFactoryAdapter
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 229 more
Caused by: java.lang.RuntimeException: Failed to serialize com.google.inject.internal.InternalFactoryToInitializableAdapter#initializable for class com.google.inject.internal.InternalFactoryToInitializableAdapter
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 237 more
Caused by: java.lang.RuntimeException: Failed to serialize com.google.inject.internal.Initializables$1#val$instance for class com.google.inject.internal.Initializables$1
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 245 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.ExtensionFinder$GuiceFinder$SezpozModule$1#this$1 for class hudson.ExtensionFinder$GuiceFinder$SezpozModule$1
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 253 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.ExtensionFinder$GuiceFinder$SezpozModule#index for class hudson.ExtensionFinder$GuiceFinder$SezpozModule
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 261 more
Caused by: java.lang.RuntimeException: Failed to serialize net.java.sezpoz.IndexItem#instance for class net.java.sezpoz.IndexItem
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:55)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 269 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.node_monitors.AbstractNodeMonitorDescriptor#record for class hudson.node_monitors.ClockMonitor$1
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 282 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.node_monitors.AbstractNodeMonitorDescriptor$Record#data for class hudson.node_monitors.AbstractNodeMonitorDescriptor$Record
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 290 more
Caused by: java.lang.RuntimeException: Failed to serialize hudson.slaves.SlaveComputer#taskListener for class hudson.slaves.SlaveComputer
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:130)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:120)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:94)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:57)
	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:176)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:163)
	... 298 more
上级 92539542
......@@ -1644,6 +1644,26 @@ public class Queue extends ResourceController implements Saveable {
return run.getParent().getFullName() + "#" + run.getNumber();
}
});
/**
* Reconnect every reference to {@link Queue} by the singleton.
*/
XSTREAM.registerConverter(new AbstractSingleValueConverter() {
@Override
public boolean canConvert(Class klazz) {
return Queue.class.isAssignableFrom(klazz);
}
@Override
public Object fromString(String string) {
return Jenkins.getInstance().getQueue();
}
@Override
public String toString(Object item) {
return "queue";
}
});
}
/**
......
......@@ -31,6 +31,8 @@ import hudson.matrix.MatrixBuild;
import hudson.matrix.MatrixProject;
import hudson.matrix.TextAxis;
import hudson.model.Cause.*;
import hudson.model.Queue.*;
import hudson.model.Queue.*;
import hudson.tasks.Shell;
import hudson.triggers.SCMTrigger.SCMTriggerCause;
import hudson.triggers.TimerTrigger.TimerTriggerCause;
......@@ -43,6 +45,7 @@ import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.io.FileUtils;
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.SequenceLock;
import org.jvnet.hudson.test.TestBuilder;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.bio.SocketConnector;
......@@ -117,6 +120,38 @@ public class QueueTest extends HudsonTestCase {
assertEquals(0,q.getItems().length);
}
/**
* {@link Queue.BlockedItem} is not static. Make sure its persistence doesn't end up re-persisting the whole Queue instance.
*/
public void testPersistenceBlockedItem() throws Exception {
Queue q = jenkins.getQueue();
final SequenceLock seq = new SequenceLock();
FreeStyleProject p = createFreeStyleProject();
p.getBuildersList().add(new TestBuilder() {
@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
seq.phase(0); // first, we let one build going
seq.phase(2);
return true;
}
});
Future<FreeStyleBuild> b1 = p.scheduleBuild2(0);
seq.phase(1); // and make sure we have one build under way
// get another going
Future<FreeStyleBuild> b2 = p.scheduleBuild2(0);
Thread.sleep(1000);
Queue.Item[] items = q.getItems();
assertEquals(1,items.length);
assertTrue(items[0] instanceof BlockedItem);
q.save();
}
public static final class FileItemPersistenceTestServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册