Hi Gabriel, I've found a problem with the default converter. If you add the jackson extension, you will notice that this client code works: ContactResource resource = cr.wrap(ContactResource.class); Contact contact = resource.retrieve();
In this case, the client and the server exchange a json representation of the contact which is automatically deserialized on client side. Regarding the default converter that supports the exchange of serialized Java objects, it is based on the java.io.ObjectInputStream class. It seems that it goes to a premature end of stream exception. Best regards, THierry Boileau Hi Gabriel, > > I've also tested using NetBeans 7.1 and JDK 1.6. I've just opened your > test project and added jars from the "jse"edition, release2.0.11. It works > nicely for me. I don't know what to think about it... > > Best regards, > Thierry Boileau > > > Hello Gabriel, >> >> that's really weird, I've tried your sample code, and it simply works for >> me. I've just created an Eclipse project with your source code and added >> the org.restlet.jar taken from 2.0.11 version. >> I will try in a servlet container, then in Netbeans. >> Once added the jackson extension, your client test code is also able to >> retrieve a json representation of the Contact, with correct values. >> >> Best regards, >> Thierry Boileau >> >> >> Hello, >>> >>> I've attached a file with a very simple example based in the restlet >>> example from the restlet web. >>> >>> In this example a very simple server is run that exposes the Contact >>> resource as a Java Object representation. >>> If the Contact resource that is retrieved by the client has any int >>> field with a negative value (in the example attached I've changed the age >>> field on the ContactServerResorce to be a "-1" ) then when the client tries >>> to retrieve the Contact, it is always null. >>> If the age field is positive the contact is retrieved without problem. >>> I've test this in windows and linux, JDK 1.6 and JDK1.7, with >>> restletjse2.1RC2 and the nightshot. Also with the 2.0.10, and it always is >>> null if any integer is negative in the POJO. >>> >>> Also if I change the int for a double, it works. >>> This is making me crazy. >>> Can anybody help me please? >>> Thank you in advance >>> Gabriel >>> PD: the attached file is a netbeans project, however it is not need to >>> compile the source. >>> >>> ------------------------------------------------------ >>> >>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2918603 >> >> >> > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2919257

