Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restlet On Android - Issues with serialization

I am trying to retrieve serialized classes using Restlet 2.1 with Android as the client and GAE as the server. This is the relevant code:

ClientResource cr = new ClientResource("http://localhost:8888/mydata");
// Get the MyData object
MyDataResource resource = cr.wrap(MyDataResource.class);
MyData myData = resource.retrieve();

I initially tested this in a standalone JSE class, and everything worked fine. When I try to run the same thing in Android, the myData object is null. Any ideas?

like image 407
oviroa Avatar asked May 03 '26 05:05

oviroa


1 Answers

You can check here the Android specificities: RESTLet android page

I spent few hours before to understand the problem as well, you need to explicitly register the Jackson convertor like that :

Engine.getInstance().getRegisteredConverters().add(new JacksonConverter());
like image 144
Greenbecq Avatar answered May 05 '26 19:05

Greenbecq