Details
-
Type: Bug
-
Status: Closed
-
Resolution: Cannot Reproduce
-
Affects Version/s: None
-
Fix Version/s: 1.1.2
-
Component/s: None
-
Labels:None
Description
I have an object containing a java.util.Collection which is in fact an UnmodifiableCollection (obtained by calling Collections.unmodifiableCollection(aCollection)).
The XML serialized form of this object is :
...
<securityContext>
<securityGroups class="java.util.Collections-UnmodifiableCollection">
<c class="list">
<string>Guichetier</string>
</c>
</securityGroups>
</securityContext>
...
The XML marshalling works, but not the unmarshalling.
I get the following error :
com.thoughtworks.xstream.converters.ConversionException: Cannot construct java.util.Collections$UnmodifiableCollection: java/util/Collections$UnmodifiableCollection
---- Debugging information ----
required-type : java.util.Collections$UnmodifiableCollection
cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message : Cannot construct java.util.Collections$UnmodifiableCollection: java/util/Collections$UnmodifiableCollection
message : Cannot construct java.util.Collections$UnmodifiableCollection: java/util/Collections$UnmodifiableCollection
class : ibp.ate.common.context.UserEnvironmentImpl
path : /ibp.ate.common.context.UserEnvironmentImpl/securityContext/securityGroups
-------------------------------
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(Unknown Source)
at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(Unknown Source)
at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.unmarshal(Unknown Source)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(Unknown Source)
at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(Unknown Source)
at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.unmarshal(Unknown Source)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(Unknown Source)
at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(Unknown Source)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(Unknown Source)
at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(Unknown Source)
at com.thoughtworks.xstream.XStream.unmarshal(Unknown Source)
at com.thoughtworks.xstream.XStream.fromXML(Unknown Source)
at com.thoughtworks.xstream.XStream.fromXML(Unknown Source)
Gilles,
Please can you specify which JVM you are using (vendor and platform).
thanks
-Joe