AFAIK, 1.2 and 1.3.1 are not binary compatible, 1.3.1 needs a different configuration mechanism to find its mappers and converters, hence the NPE.

The configuration is all in XStream081Configuration.

I can do the port if you like, although not immediately as my employer has me focused on other things at the moment, was there a reason for the upgrade other than wanting the latest version ? Do you have a timescale you need to meet ?


And, yes, all that reflection/configuration is twisty, IMHO at the moment is just on the side of benefit over hindrance, but if no one else can understand it, then thats more hinderance.

Ian
On 15 Jan 2009, at 02:11, Paul Lindner wrote:

We fail tests when upgrading from xstream 1.2 to 1.3.1, this is caused by NPE here. Any ideas why? That xstream code looks pretty twisty...


Tests run: 7, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.09 sec <<< FAILURE! testPersonToXml (org .apache .shindig.social.opensocial.util.BeanXStreamAtomConverterTest) Time elapsed: 0.016 sec <<< ERROR!
java.lang.NullPointerException
at com .thoughtworks .xstream .mapper .AttributeMapper.getLocalConverterFromItemType(AttributeMapper.java: 72) at com .thoughtworks .xstream .mapper .AttributeMapper.getConverterFromItemType(AttributeMapper.java:94) at com .thoughtworks .xstream.converters.reflection.AbstractReflectionConverter $1.visit(AbstractReflectionConverter.java:81) at com .thoughtworks .xstream .converters .reflection .PureJavaReflectionProvider .visitSerializableFields(PureJavaReflectionProvider.java:129) at com .thoughtworks .xstream .converters .reflection .AbstractReflectionConverter .doMarshal(AbstractReflectionConverter.java:67) at com .thoughtworks .xstream .converters .reflection .AbstractReflectionConverter .marshal(AbstractReflectionConverter.java:58) at com .thoughtworks .xstream.core.TreeMarshaller.convert(TreeMarshaller.java:86) at com .thoughtworks .xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78) at com .thoughtworks .xstream .converters .reflection .AbstractReflectionConverter .marshallField(AbstractReflectionConverter.java:157) at com .thoughtworks .xstream.converters.reflection.AbstractReflectionConverter $2.writeField(AbstractReflectionConverter.java:148) at com .thoughtworks .xstream.converters.reflection.AbstractReflectionConverter $2.visit(AbstractReflectionConverter.java:118) at com .thoughtworks .xstream .converters .reflection .PureJavaReflectionProvider .visitSerializableFields(PureJavaReflectionProvider.java:129) at com .thoughtworks .xstream .converters .reflection .AbstractReflectionConverter .doMarshal(AbstractReflectionConverter.java:100) at com .thoughtworks .xstream .converters .reflection .AbstractReflectionConverter .marshal(AbstractReflectionConverter.java:58) at com .thoughtworks .xstream.core.TreeMarshaller.convert(TreeMarshaller.java:86) at com .thoughtworks .xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78) at com .thoughtworks .xstream .converters .reflection .AbstractReflectionConverter .marshallField(AbstractReflectionConverter.java:157) at com .thoughtworks .xstream.converters.reflection.AbstractReflectionConverter $2.writeField(AbstractReflectionConverter.java:148) at com .thoughtworks .xstream.converters.reflection.AbstractReflectionConverter $2.visit(AbstractReflectionConverter.java:112) at com .thoughtworks .xstream .converters .reflection .PureJavaReflectionProvider .visitSerializableFields(PureJavaReflectionProvider.java:129) at com .thoughtworks .xstream .converters .reflection .AbstractReflectionConverter .doMarshal(AbstractReflectionConverter.java:100) at com .thoughtworks .xstream .converters .reflection .AbstractReflectionConverter .marshal(AbstractReflectionConverter.java:58) at com .thoughtworks .xstream.core.TreeMarshaller.convert(TreeMarshaller.java:86) 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:837)
       at com.thoughtworks.xstream.XStream.marshal(XStream.java:826)
       at com.thoughtworks.xstream.XStream.toXML(XStream.java:801)
       at com.thoughtworks.xstream.XStream.toXML(XStream.java:789)
at org .apache .shindig .social .core .util .BeanXStreamAtomConverter .convertToString(BeanXStreamAtomConverter.java:66)




Reply via email to