Thanks Thierry, sorry for not answering any sooner. I had found the solution by
myself a few minutes after posting (...), but couldn't say it before the post
was accepted.
About the "void" issue... It seems that I had been using a pre-M1 release of
Restlet 2.0. Getting the M1 fixed the problem. Sorry for bullshiting.
In fact, everything is working pretty well, which is cool. However, I still
have a blocking issue !
When the auth cookie is expired, AppEngine redirects the HTTP call to the auth
page. However, Restlet follows the redirect, and return null.
The JacksonRepresentation should not return null when not being able to parse a
JSON stream, it should throw an exception. Otherwise, how can we handle errors
? See JacksonRepresentation line 129 :
public T getObject() {
T result = null;
if (this.object != null) {
result = this.object;
} else if (this.jsonRepresentation != null) {
try {
result = getObjectMapper().readValue(
this.jsonRepresentation.getStream(), this.objectClass);
} catch (IOException e) {
Context.getCurrentLogger().log(Level.WARNING,
"Unable to parse the object with Jackson.", e);
}
}
return result;
}
I tried to disable followRedirects on client resource. However, in this case,
the toObject method from the ConverterService (line 144) is given an
"EmptyRepresentation" as a source. And therefore the method returns null.
I'd like to be able to tweek the InvocationHandler so that it might throws
exceptions when getting a redirect and not following it.
However, for now, I think I'll subclass the JacksonRepresentation and
JacksonConverter, and throw exceptions when it fails to parse the object.
I also found a Jackson framework issue : when ObjectMapper class is loaded, it
tries to load a bunch of classes that are not available. This doesn't cause any
bug (only appears in logs), but it takes a looooong time and slows down the
startup. I'll post a bug report on the Jackson framework page.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2644199