Restlet server on Android: ResourceException: Unprocessable Entity (422)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Restlet server on Android: ResourceException: Unprocessable Entity (422)

Francis Leblanc
Hi !

I am having a hard time creating a simple Java Restlet server on Android.
I just want to answer a simple GET and return a class containing a float value.

I know I am almost there, the PLAIN_TEXT client-server interaction works, but I would like to pass a java class to skip any parsing for future, more complex classes.
There is something I don't understand in regards to the way I pass a Serializable class through Restlet.

Here is my StackOverflow post:
http://stackoverflow.com/questions/33311268/

Thanks a lot !
Francis

To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Restlet server on Android: ResourceException: Unprocessable Entity (422)

Thierry Templier-3
Hi Francis,

I posted an answer to your question on StackOverflow. In fact, you simply forgot to define a default constructor for your data class. Jackson requires this constructor to instantiate it and deserialize response content in it on the client side.

Thierry

2015-10-26 19:02 GMT+01:00 Francis L. <[hidden email]>:
Hi !

I am having a hard time creating a simple Java Restlet server on Android.
I just want to answer a simple GET and return a class containing a float value.

I know I am almost there, the PLAIN_TEXT client-server interaction works, but I would like to pass a java class to skip any parsing for future, more complex classes.
There is something I don't understand in regards to the way I pass a Serializable class through Restlet.

Here is my StackOverflow post:

Thanks a lot !
Francis



--
Best,
Thierry
--
Thierry Templier, Lead Architect


Restlet SAS, 6 rue Rose Dieng-Kuntz • 44300 Nantes  France

To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Restlet server on Android: ResourceException: Unprocessable Entity (422)

Francis Leblanc
Thanks, you nailed it !
I never saw the error you mentioned, and I agree it would give some kind of hint... but still a bit far fetched !

Francis

On Tuesday, October 27, 2015 at 11:02:05 AM UTC-4, ttemplier wrote:
Hi Francis,

I posted an answer to your question on StackOverflow. In fact, you simply forgot to define a default constructor for your data class. Jackson requires this constructor to instantiate it and deserialize response content in it on the client side.

Thierry

2015-10-26 19:02 GMT+01:00 Francis L. <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Gv46B1jqBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">francis...@...>:
Hi !

I am having a hard time creating a simple Java Restlet server on Android.
I just want to answer a simple GET and return a class containing a float value.

I know I am almost there, the PLAIN_TEXT client-server interaction works, but I would like to pass a java class to skip any parsing for future, more complex classes.
There is something I don't understand in regards to the way I pass a Serializable class through Restlet.

Here is my StackOverflow post:
<a href="http://stackoverflow.com/questions/33311268/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fstackoverflow.com%2Fquestions%2F33311268%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFbFQQFV_6eU4XwMLjXYTfEqhFHjQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fstackoverflow.com%2Fquestions%2F33311268%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFbFQQFV_6eU4XwMLjXYTfEqhFHjQ&#39;;return true;">http://stackoverflow.com/questions/33311268/

Thanks a lot !
Francis



--
Best,
Thierry
--
Thierry Templier, Lead Architect
<a href="javascript:" style="color:rgb(17,85,204)" target="_blank" gdf-obfuscated-mailto="Gv46B1jqBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ttem...@...


Restlet SAS, 6 rue Rose Dieng-Kuntz • 44300 Nantes  France

To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Loading...