Hi Adi, adimaron wrote:
> > > Hello, > > I have recently upgraded from XStream1.1.2 to 1.4.2 to overcome a problem > that appeared when running my java application with java7. I hope you realize that you're upgrading from a 7 year old code base? And you did read at least http://xstream.codehaus.org/faq.html#Compatibility_XStream11 ? > However, when I now try to load a data object that was saved using XStream > 1.1.2 I am getting the following Error message, concerning one of my data > structures that is derived from java.util.Hashtable: > > ---- Debugging information ---- > message : Could not call > edu.tau.compbio.util.OrderedHash.readObject() > cause-exception : > com.thoughtworks.xstream.mapper.CannotResolveClassException > cause-message : edu.tau.compbio.io.IOMgr-Constraints > class : edu.tau.compbio.util.OrderedHash > required-type : edu.tau.compbio.util.OrderedHash > converter-type : > com.thoughtworks.xstream.converters.reflection.SerializableConverter > path : > /expander.ds.MainData/studies/entry/expander.ds.PreprocGEData/preprocOps/expander.ds.FilterSol/opInput/_inputDef/hashtable/edu.tau.compbio.io.IOMgr- Constraints > class[1] : edu.tau.compbio.io.IOMgr > converter-type[1] : > com.thoughtworks.xstream.converters.reflection.ReflectionConverter > class[2] : expander.ds.FilterSol > class[3] : java.util.ArrayList > converter-type[2] : > com.thoughtworks.xstream.converters.collections.CollectionConverter > class[4] : expander.ds.PreprocGEData > class[5] : java.util.Hashtable > converter-type[3] : > com.thoughtworks.xstream.converters.collections.MapConverter > class[6] : expander.ds.MainData > version : null > ------------------------------- Can you please provide the complete stack trace? > I have tried adding the following code to my OrderedHash class: > private void writeObject(ObjectOutputStream oos) throws > IOException { > System.out.println("writing..."); > oos.defaultWriteObject(); > System.out.println("wrote..."); > } > > private void readObject(ObjectInputStream ois) throws IOException, > ClassNotFoundException { > System.out.println("reading"); > ois.defaultReadObject(); > System.out.println("read"); > } Please, don't. This will create even more confusion, because XStream keeps track if those methods have been there before. The error message above simply states that the error happened while readObject was executed. > This did not solve the problem. > > I also tried adding the code > xstream.setClassLoaded(new CompositeClassLoader()); > right after creating the xstream object but no luck there either. And what effect should that have had? > Any suggestions will be most appreciated.... XStream complains that it did not find class "edu.tau.compbio.io.IOMgr- Constraints". Since this is not a valid Java class name, I cannot say anymore, because I don't know how this name got into the XML. - Jörg --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
