Hi,
Has anyone made XStream work to de-serialize a XML encoded object?
Here is the code I'm using. It works fine on my local box but fails at
Google environment. However serializing a Object to xml works fine.
I'm using XPP3 jar library along with xstream-gae.jar
Here is the error message from my google log.
gobeshona.xstreamtest.XstreamTest deserializeObject: access denied
(java.io.SerializablePermission enableSubclassImplementation)
Here is my code snippet:
private void deserializeObject(){
log.info("starting inputstream is");
InputStream is = null;
try {
is = getClass().getClassLoader().getResourceAsStream
("persons.xml");
log.info("is size " + is.available());
}catch (Exception e){
log.info("Exception reading file as stream");
log.info(e.getMessage());
}
try {
XStream xstream = new XStream();
log.info("starting createObjectInputStream");
ObjectInputStream in =
xstream.createObjectInputStream(is);
Person a = (Person)in.readObject();
log.info(a.getFirstName());
}catch (Exception e){
log.info("Exception : ObjectInputStream");
log.info(e.getMessage());
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---