Details
-
Type: Bug
-
Status: Closed
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
We use Spring to pass around an xstream within our application... the problem with caching occurs when a field type in a serialized class changes. The following error occurs:
com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Could not get field class java.lang.reflect.Field.name : null
at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:110)
at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.marshal(ReflectionConverter.java:44)
at com.thoughtworks.xstream.core.ReferenceByXPathMarshaller.convertAnother(ReferenceByXPathMarshaller.java:36)
at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:46)
at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.marshal(ReferenceByXPathMarshallingStrategy.java:17)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:489)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:479)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:464)
We are currently using XStream 1.1.1 and have also tested with 1.2 (although I had to modify something because it complained about the different cgi version we are using when using the XStream constructor). A work around for this caching is to simply call new XStream().
Hello Agnes, the caching is by design. Nevertheless I don't understand your use case, how the field in a serialized class can suddenly change. Please let us continue on the user's list.