Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unneeded contention in DefaultConverterLookup #2

Closed
MrEasy opened this issue May 4, 2015 · 12 comments

Comments

@MrEasy
Copy link

commented May 4, 2015

Hi,

DefaultConverterLookup#lookupConverterForType uses a synchronized Map, which produces a lot of contention with parallel threads.
This Map was made synhronized with fix for http://jira.codehaus.org/browse/XSTR-744.

I recommend to replace the synchronized Map with a thread-safe ConcurrentMap implementation (e.g. java.util.concurrent.ConcurrentHashMap) to make it
a) thread-safe (the original issue with XSTR-744
and
b) non-blocking on read-access

See for an example thread-dump showing several BLOCKED threads waiting for one RUNNABLE in read-access.

"Thread-7310" Id=8514 in RUNNABLE
    at java.util.Collections$SynchronizedMap.get(Collections.java:2584)
      - locked java.util.Collections$SynchronizedMap@13ad5060
    at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:49)
    at com.thoughtworks.xstream.XStream$1.lookupConverterForType(XStream.java:498)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:48)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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.company.base.util.jaxb.XStreamJAXBConverter.marshal(XStreamJAXBConverter.java:77)
    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:79)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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:1043)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1032)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:1020)
    at com.company.recover.impl.fs.FSJobSerializer.serializeJob(FSJobSerializer.java:244)
      - locked com.company.recover.impl.GenericRecoveryJob@3736819
    at com.company.recover.impl.db.RecoveryPoolDBImpl.specificSave(RecoveryPoolDBImpl.java:291)
    at com.company.recover.impl.GenericRecoveryPool.saveJob(GenericRecoveryPool.java:231)
    at com.company.recover.RecoverManager.save(RecoverManager.java:479)
    at com.company.frame.core.FrameWorkRJobHandler.save(FrameWorkRJobHandler.java:511)
    at com.company.frame.header.GenericTask.save(GenericTask.java:434)
    at com.company.httpcontroller.core.SHCTaskInitiator.run(SHCTaskInitiator.java:132)
    at java.lang.Thread.run(Thread.java:745)

    Locked synchronizers: count = 0


"Thread-7307" Id=8511 in RUNNABLE
    at java.util.Collections$SynchronizedMap.get(Collections.java:2584)
      - locked java.util.Collections$SynchronizedMap@13ad5060
    at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:49)
    at com.thoughtworks.xstream.XStream$1.lookupConverterForType(XStream.java:498)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:48)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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.company.base.util.jaxb.XStreamJAXBConverter.marshal(XStreamJAXBConverter.java:77)
    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:79)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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:1043)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1032)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:1020)
    at com.company.recover.impl.fs.FSJobSerializer.serializeJob(FSJobSerializer.java:244)
      - locked com.company.recover.impl.GenericRecoveryJob@406c3657
    at com.company.recover.impl.db.RecoveryPoolDBImpl.specificSave(RecoveryPoolDBImpl.java:291)
    at com.company.recover.impl.GenericRecoveryPool.saveJob(GenericRecoveryPool.java:231)
    at com.company.recover.RecoverManager.save(RecoverManager.java:479)
    at com.company.frame.core.FrameWorkRJobHandler.save(FrameWorkRJobHandler.java:511)
    at com.company.frame.header.GenericTask.save(GenericTask.java:434)
    at com.company.httpcontroller.impl.SHCTaskProcessor.preInitiation(SHCTaskProcessor.java:138)
    at com.company.httpcontroller.core.SHCTaskInitiator.doInitiation(SHCTaskInitiator.java:197)
    at com.company.httpcontroller.core.SHCTaskInitiator.run(SHCTaskInitiator.java:152)
    at java.lang.Thread.run(Thread.java:745)

    Locked synchronizers: count = 0


"Thread-7304" Id=8508 in BLOCKED on lock=java.util.Collections$SynchronizedMap@13ad5060     owned by Thread-7301 Id=8500
    at java.util.Collections$SynchronizedMap.get(Collections.java:2584)
    at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:49)
    at com.thoughtworks.xstream.XStream$1.lookupConverterForType(XStream.java:498)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:48)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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:1043)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1032)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:1020)
    at com.company.recover.impl.fs.FSJobSerializer.serializeJob(FSJobSerializer.java:244)
      - locked com.company.recover.impl.GenericRecoveryJob@a0003e9
    at com.company.recover.impl.db.RecoveryPoolDBImpl.specificSave(RecoveryPoolDBImpl.java:291)
    at com.company.recover.impl.GenericRecoveryPool.saveJob(GenericRecoveryPool.java:231)
    at com.company.recover.RecoverManager.save(RecoverManager.java:479)
    at com.company.frame.core.FrameWorkRJobHandler.save(FrameWorkRJobHandler.java:511)
    at com.company.frame.header.GenericTask.save(GenericTask.java:434)
    at com.company.httpcontroller.impl.SHCTaskProcessor.preInitiation(SHCTaskProcessor.java:138)
    at com.company.httpcontroller.core.SHCTaskInitiator.doInitiation(SHCTaskInitiator.java:197)
    at com.company.httpcontroller.core.SHCTaskInitiator.run(SHCTaskInitiator.java:152)
    at java.lang.Thread.run(Thread.java:745)

    Locked synchronizers: count = 0


"Thread-7301" Id=8500 in RUNNABLE
    at java.util.Collections$SynchronizedMap.get(Collections.java:2584)
      - locked java.util.Collections$SynchronizedMap@13ad5060
    at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:49)
    at com.thoughtworks.xstream.XStream$1.lookupConverterForType(XStream.java:498)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:48)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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:1043)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1032)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:1020)
    at com.company.recover.impl.fs.FSJobSerializer.serializeJob(FSJobSerializer.java:244)
      - locked com.company.recover.impl.GenericRecoveryJob@662c66c0
    at com.company.recover.impl.db.RecoveryPoolDBImpl.specificSave(RecoveryPoolDBImpl.java:291)
    at com.company.recover.impl.GenericRecoveryPool.saveJob(GenericRecoveryPool.java:231)
    at com.company.recover.RecoverManager.save(RecoverManager.java:479)
    at com.company.frame.core.FrameWorkRJobHandler.save(FrameWorkRJobHandler.java:511)
    at com.company.frame.header.GenericTask.save(GenericTask.java:434)
    at com.company.httpcontroller.core.SHCTaskInitiator.doInitiation(SHCTaskInitiator.java:214)
    at com.company.httpcontroller.core.SHCTaskInitiator.run(SHCTaskInitiator.java:152)
    at java.lang.Thread.run(Thread.java:745)

    Locked synchronizers: count = 0


"Thread-7293" Id=8497 in BLOCKED on lock=java.util.Collections$SynchronizedMap@13ad5060     owned by Thread-7301 Id=8500
    at java.util.Collections$SynchronizedMap.get(Collections.java:2584)
    at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:49)
    at com.thoughtworks.xstream.XStream$1.lookupConverterForType(XStream.java:498)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:48)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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:1043)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1032)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:1020)
    at com.company.recover.impl.fs.FSJobSerializer.serializeJob(FSJobSerializer.java:244)
      - locked com.company.recover.impl.GenericRecoveryJob@4037f359
    at com.company.recover.impl.db.RecoveryPoolDBImpl.specificSave(RecoveryPoolDBImpl.java:291)
    at com.company.recover.impl.GenericRecoveryPool.saveJob(GenericRecoveryPool.java:231)
    at com.company.recover.RecoverManager.save(RecoverManager.java:479)
    at com.company.frame.core.FrameWorkRJobHandler.save(FrameWorkRJobHandler.java:511)
    at com.company.frame.header.GenericTask.save(GenericTask.java:434)
    at com.company.httpcontroller.core.SHCTaskInitiator.doInitiation(SHCTaskInitiator.java:214)
    at com.company.httpcontroller.core.SHCTaskInitiator.run(SHCTaskInitiator.java:152)
    at java.lang.Thread.run(Thread.java:745)

    Locked synchronizers: count = 0


"Thread-7291" Id=8495 in BLOCKED on lock=java.util.Collections$SynchronizedMap@13ad5060     owned by Thread-7301 Id=8500
    at java.util.Collections$SynchronizedMap.get(Collections.java:2584)
    at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:49)
    at com.thoughtworks.xstream.XStream$1.lookupConverterForType(XStream.java:498)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:48)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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:1043)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1032)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:1020)
    at com.company.recover.impl.fs.FSJobSerializer.serializeJob(FSJobSerializer.java:244)
      - locked com.company.recover.impl.GenericRecoveryJob@3c420efe
    at com.company.recover.impl.db.RecoveryPoolDBImpl.specificSave(RecoveryPoolDBImpl.java:291)
    at com.company.recover.impl.GenericRecoveryPool.saveJob(GenericRecoveryPool.java:231)
    at com.company.recover.RecoverManager.save(RecoverManager.java:479)
    at com.company.frame.core.FrameWorkRJobHandler.save(FrameWorkRJobHandler.java:511)
    at com.company.frame.header.GenericTask.save(GenericTask.java:434)
    at com.company.httpcontroller.core.SHCTaskInitiator.doInitiation(SHCTaskInitiator.java:214)
    at com.company.httpcontroller.core.SHCTaskInitiator.run(SHCTaskInitiator.java:152)
    at java.lang.Thread.run(Thread.java:745)

    Locked synchronizers: count = 0


"Thread-7286" Id=8490 in RUNNABLE
    at java.util.Collections$SynchronizedMap.get(Collections.java:2584)
      - locked java.util.Collections$SynchronizedMap@13ad5060
    at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:49)
    at com.thoughtworks.xstream.XStream$1.lookupConverterForType(XStream.java:498)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:48)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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.company.base.util.jaxb.XStreamJAXBConverter.marshal(XStreamJAXBConverter.java:77)
    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:79)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:256)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:232)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.(AbstractReflectionConverter.java:195)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:141)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:89)
    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:1043)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1032)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:1020)
    at com.company.recover.impl.fs.FSJobSerializer.serializeJob(FSJobSerializer.java:244)
      - locked com.company.recover.impl.GenericRecoveryJob@9829040
    at com.company.recover.impl.db.RecoveryPoolDBImpl.specificSave(RecoveryPoolDBImpl.java:291)
    at com.company.recover.impl.GenericRecoveryPool.saveJob(GenericRecoveryPool.java:231)
    at com.company.recover.RecoverManager.save(RecoverManager.java:479)
    at com.company.frame.core.FrameWorkRJobHandler.save(FrameWorkRJobHandler.java:511)
    at com.company.frame.header.GenericTask.save(GenericTask.java:434)
    at com.company.httpcontroller.core.SHCTaskInitiator.doInitiation(SHCTaskInitiator.java:222)
    at com.company.httpcontroller.core.SHCTaskInitiator.run(SHCTaskInitiator.java:152)
    at java.lang.Thread.run(Thread.java:745)

    Locked synchronizers: count = 0
@MrEasy

This comment has been minimized.

Copy link
Author

commented May 4, 2015

Ah, actually there is even a TODO in code.
Anyway, I attach a proposed patch for the issue, using a ConcurrentMap with SoftReferences instead of WeakReferences, since WeakRefs are not really suited for a cache anyhow.
See http://stackoverflow.com/a/17406797/648378 for the idea.
Let me know if you prefer a pull request instead.

diff --git a/xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java b/xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java
index 36f4bcb..28dee26 100644
--- a/xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java
+++ b/xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java
@@ -6,15 +6,15 @@
  * The software in this package is published under the terms of the BSD
  * style license a copy of which has been included with this distribution in
  * the LICENSE.txt file.
- * 
+ *
  * Created on 07. March 2004 by Joe Walnes
  */
 package com.thoughtworks.xstream.core;

-import java.util.Collections;
+import java.lang.ref.SoftReference;
 import java.util.Iterator;
-import java.util.Map;
-import java.util.WeakHashMap;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;

 import com.thoughtworks.xstream.converters.ConversionException;
 import com.thoughtworks.xstream.converters.Converter;
@@ -25,7 +25,7 @@

 /**
  * The default implementation of converters lookup.
- * 
+ *
  * @author Joe Walnes
  * @author Jörg Schaible
  * @author Guilherme Silveira
@@ -33,7 +33,7 @@
 public class DefaultConverterLookup implements ConverterLookup, ConverterRegistry, Caching {

     private final PrioritizedList<Converter> converters = new PrioritizedList<Converter>();
-    private transient Map<Class<?>, Converter> typeToConverterMap;
+    private transient ConcurrentMap<Class<?>, Converter> typeToConverterMap;

     public DefaultConverterLookup() {
         readResolve();
@@ -75,8 +75,46 @@
     }

     private Object readResolve() {
-        // TODO: Use ConcurrentMap
-        typeToConverterMap = Collections.synchronizedMap(new WeakHashMap<Class<?>, Converter>());
+        typeToConverterMap = new SoftConcurrentMap<Class<?>, Converter>();
         return this;
     }
+
+
+    class SoftConcurrentMap<K, V> extends ConcurrentHashMap<K, V> {
+
+        /** field <code>serialVersionUID</code> */
+        private static final long serialVersionUID = 1L;
+
+        private ConcurrentHashMap<SoftReference<K>, SoftReference<V>> map = new ConcurrentHashMap<SoftReference<K>, SoftReference<V>>();
+
+        /**
+         * @see java.util.concurrent.ConcurrentHashMap#get(java.lang.Object)
+         */
+        @Override
+        public V get(Object key)
+        {
+            SoftReference<V> valueSoft = map.get(new SoftReference(key));
+            V valueHard = null;
+            if(valueSoft != null) {
+                valueHard = valueSoft.get();
+            }
+
+            if (valueHard == null) {
+                map.remove(new SoftReference(key));
+            }
+
+            return valueHard; // may be null
+        }
+
+        /**
+         * @see java.util.concurrent.ConcurrentHashMap#put(java.lang.Object, java.lang.Object)
+         */
+        @Override
+        public V put(K key, V value)
+        {
+            SoftReference<V> oldValue = map.put(new SoftReference(key), new SoftReference<>(value));
+            return oldValue == null ? null : oldValue.get();
+        }
+
+    }
 }
@joehni

This comment has been minimized.

Copy link
Member

commented May 8, 2015

Hi Nico,

the synchronization has nothing to do with XSTR-744, it has been there since version 1.1.1. Otherwise you would have never been able to run the marshalling concurrently.

Additionally we will keep the WeakReferences. Originally we used a plain HashMap with the type as key. However, this causes memory leaks for web application class loaders in combination with a static XStream instance. Since the keys are class types, they will always be referenced from the outside (the class loader) and there's no reason for the GC to collect them ... except when the ClassLoader is gc'ed.

Using soft references may cause more troubles in this scenario:

However, ConcurrentMap will be introduced now as master requires Java 6.

@MrEasy

This comment has been minimized.

Copy link
Author

commented May 8, 2015

Thanks Jörg for looking into it.

(Rico, not Nico, but you wrote it correctly on http://xstream.codehaus.org/team.html#contributors, so I got that goin' for me which is nice ;))

@MrEasy

This comment has been minimized.

Copy link
Author

commented Oct 15, 2015

@joehni Saw you updated to Java 7 as minimum for version 1.5.x. 5 days ago :)
Do you prefer another patch/pull-request, for the changes above with regard to your comments with weak vs. soft references, or planning on working it in differently?

@joehni

This comment has been minimized.

Copy link
Member

commented Oct 15, 2015

Hi Rico,

I'll work automatically through all places using old synchronization mechanisms. So, I am more interested in reviews after this change. Maybe there are some other good ideas ;-)

@MrEasy

This comment has been minimized.

Copy link
Author

commented Oct 15, 2015

@joehni 👍

@gdubya

This comment has been minimized.

Copy link

commented Dec 8, 2017

Any progress on this issue in the last 2 years? we just encountered a similar problem to #32 - 100% CPU and thread dump indicates lots of threads contending for DefaultConverterLookup.lookupConverterForType

@gdubya

This comment has been minimized.

Copy link

commented Dec 8, 2017

This Jenkins issue is possibly related: https://issues.jenkins-ci.org/browse/JENKINS-19561

@joehni

This comment has been minimized.

Copy link
Member

commented Dec 11, 2017

Actually I have no idea, why this map is synchronized at all. XStream does not guarantee thread-safety at the configuration phase and there are a lot of other situations where worse things can happen. So there's no point for a synchronized map here.

@joehni

This comment has been minimized.

Copy link
Member

commented Dec 11, 2017

... and the Jenkins guys modified DefaultConverterLookup by defining all kind of methods synchronized. So they have a synchronization point at class level and one at the map instance and the latter is nested.

joehni added a commit that referenced this issue Dec 21, 2017
@joehni joehni closed this in 1bde8d4 Dec 21, 2017
@joehni

This comment has been minimized.

Copy link
Member

commented Dec 21, 2017

As said, it does not make sense to synchronize here while all the mappers that keep also configuration data are not synchronized. The DefaultConverterLookup has now an additional constructor to provide the instance with an arbitrary Map implementation ... which might be synchronized. Since the DefaultConverterLookup can be provided as parameter to the XStream constructor (well, once in LookupReference and LookupRegistry) everyone can provide better synchronized implementations in case of need (without forking XStream).

@joehni joehni added this to the 1.4.x milestone Dec 21, 2017
joehni added a commit that referenced this issue Dec 21, 2017
joehni added a commit that referenced this issue Dec 21, 2017
@MrEasy

This comment has been minimized.

Copy link
Author

commented Dec 21, 2017

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.