Java serialization issues in Restlet versions above 2.1-M4

I am trying to run a very simple application for the Restlet example, available here http://restlet.org/learn/guide/2.2/introduction/first-steps/first-application

I try to run the client on an Android device, but I get the following error:

Unable to convert a [application/json,UTF-8] representation into an object of class org.restlet.example.common.Contact
java.io.IOException: Unable to create the Object representation
org.restlet.engine.converter.DefaultConverter.toObject(DefaultConverter.java:291)
org.restlet.service.ConverterService.toObject(ConverterService.java:170)
org.restlet.resource.Resource.toObject(Resource.java:828)
org.restlet.engine.resource.ClientInvocationHandler.invoke(ClientInvocationHandler.java:240)
$Proxy7.retrieve(Native Method)
org.restlet.example.serialisation.android.activity.ContactActivity$2.run(ContactActivity.java:142)
java.lang.Thread.run(Thread.java:1096)
java.lang.IllegalArgumentException: The serialized representation must have this media type: application/x-java-serialized-object or this one: application/x-java-serialized-object+xml
org.restlet.representation.ObjectRepresentation.<init>(ObjectRepresentation.java:204)
org.restlet.representation.ObjectRepresentation.<init>(ObjectRepresentation.java:133)
org.restlet.representation.ObjectRepresentation.<init>(ObjectRepresentation.java:114)
org.restlet.engine.converter.DefaultConverter.toObject(DefaultConverter.java:288)

The only way to get this application to work is to use Restlet 2.1-M4. I tried with 2.2-RC2 and even with the "stable" release 2.1.7.

I understand that the application was tested using the "Restlet Framework 2.1 Milestone 4", but it seems too strange to me that a later stable release, such as 2.1.7, is for a trivial example, such as this!

, , - , "" . , , , 2.1-m4, java, / , 2.1-m4.

.

,

+3

All Articles