I would like to create a REST interface for my Java Google App Engine program. I figured I would start by generating some XML from my POJOS. However, it seems that XStream is bitten by GAE's restrictions.
What can I use to generate an XML string in Google App Engine?
Thanks.
Edit 1: Here is the beginning of the exception:
javax.servlet.ServletContext log: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String com.mydomain.client.ObjectService.sendObject(com.mydomain.client.models.myobject)' threw an unexpected exception: java.security.AccessControlException: access denied (java.io.SerializablePermission enableSubclassImplementation)
For the same restriction (a patch is underway however) I ended producing JSON using org.json library. Also JAXB seems not to be in the whitelist.
The exception is caused by a java.io.SerializablePermission, which according the javadoc is for allowing:
XStream might be using Object streams under the covers, and falling foul of this permission not being granted.
Does Google App Engine actually have a whitelist, or just a set of restricted permissions? JAXB2 doesn't use Object streams, so have you actually tried that?
Try Jersey - it will give you XML, JSON, and lots more via REST; all using annotated methods.
It works for me, however there are some caveats:
See here and here