Jerome Louvel | 7 Feb 00:05 2014

GitHub issues reorganization

Hi all,

In preparation of the new Restlet Framework 3.0 dev cycle, some clean-up was due in our GitHub issue tracker.

I have just reorganized the tags for clarity and constency based on our recent experience. We now have six aspects/dimensions for an issue:
  • Distribution: Zip | Maven | Eclipse (p2) | Windows
  • Version: 2.1 | 2.2 | 3.0
  • Edition: Android | GAE |GWT | Java SE | Java EE | OSGi
  • Module: Restlet API | Restlet Engine | Forge | Documentation
  • Extension: Atom | Crypto | ...
  • State: new | analysis | implementation | testing | escalated
  • Type: bug | feature | enhancement | task
  • Priority: critical | high | medium | low
Work still has to be done to properly label existing issues, but when you enter new issues, please try to properly set the labels for each dimension.

I've also cleaned up our milestones so provide the realistic set of issues that we are working on instead of the desired set. We will now use the "Priority" level to express this.

Here is the current set of milestones we have:
Best regards,
Andy Dennie | 25 Jan 14:33 2014

suggestion for facilitating exception translation

All of my ServerResource subclasses have methods containing exception translation boilerplate, like

public class MyResource extends MyBaseResource { 
     <at> Get 
    public Foo getFoo() { 
        Foo result = null; 
        try { 
            result = .... 
        catch (RuntimeException e) { 
        return result; 

and then MyBaseResource implements doCatch like this: 

    protected void doCatch(final RuntimeException e) { 
        Class<?> exceptionClass = e.getClass(); 
        if (IllegalArgumentException.class.isAssignableFrom(exceptionClass)) { 
            // chain & translate to a 400 
            throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST, e.getMessage(), e); 

        // NotFoundException is a custom exception class I've defined
        if (NotFoundException.class.isAssignableFrom(exceptionClass)
                || IndexOutOfBoundsException.class.isAssignableFrom(exceptionClass)) {
            // chain & translate to a 404
            throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, e.getMessage(), e);

        if (UnsupportedOperationException.class.isAssignableFrom(exceptionClass)) {
            // chain & translate to a 405
            throw new ResourceException(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED, e.getMessage(), e);

        // ConflictException is a custom exception class I've defined
        if (ConflictException.class.isAssignableFrom(exceptionClass)
                || IllegalStateException.class.isAssignableFrom(exceptionClass)) {
            // chain & translate to a 409
            throw new ResourceException(Status.CLIENT_ERROR_CONFLICT, e.getMessage(), e);

        throw e; 

It would be nice if I didn't have to put that try/catch boilerplate in all my  <at> Get,  <at> Put,  <at> Post, etc. methods. 

I was thinking that a method like 
    protected ResourceException translateException(final RuntimeException e) 

defined on ServerResource would be nice to have.  It could be called from ServerResource.doHandle if an
exception is thrown, giving the resource object a chance to do the translation to a ResourceException.  If
that method returned null, then ServerResource could do its own translation. 



Jerome Louvel | 21 Sep 00:46 2013

New IntelliJ IDEA license

We have received a new license for IntelliJ IDEA that was kindly offered by JetBrains. Thanks to Martin Svenson for handling the process.

Restlet committers can contact me in order to get a copy.

Best regards,

Paul Sprague | 7 May 16:51 2013

How to implement an AMQP client+server connector?


Can anyone on this list make some recommendations as to how a connector could be implemented that isn't
based on HTTP? I was initially think that I needed to implement a connector, connection, controller,
in/outbound ways, etc. But after looking at the code I'm not so sure this is the correct approach.

My thought was to leverage Apache Qpid as the underlying implementation. I just need some idea as to how I can
integrate it into restlet.



Juan | 7 Jan 21:11 2013

access webservice with hostname versus localhost

I have been playing with the Restlet examples, seems that the URI defined in the router.attach call
(http://localhost:8111/hello) needs to called exactly like it from the clients, including the host
name. If my local machine is named galaxy18 and i run the webservice and local client, I can only access it
via localhost:8111/hello. If I change the router.attach to http://galaxy18:8111/hello then the
client can access it with galaxy18 but not with localhost.

I don't like hardcording, especially machine names, if you can imagine this will be a pain if my webservice
is running on different machines.

Is this an instance where I need to use read the hostname into a variable then use that in the router.attach or
am i missing something basic here?


Jerome Louvel | 1 Oct 13:46 2012

Restlet license for IntelliJ IDE

Hi all,


For Restlet code contributors, we have a free license available thanks to JetBrains.


Please contact us directly for additional information.






Cyril Lakech | 23 Jul 19:19 2012

Restlet 2.1-RC5 and GWT 2.4 POST entity issue


We use Restlet 2.1-RC5 and GWT 2.4 with restlet gwt extension and we
face a 415 error on posting content from the GWT app to the restlet
API: "Too few tokens in RPC request" (see errors below [1])

We can't find any solution to this exception. Debugging restlet/gwt
doesn't help...

Here is a sample of an entity sent to the server :


GET works perfectly, but when we try to POST/PUT content to the server
we get a 415 error

Any idea ?


Jul 23, 2012 4:01:21 PM org.restlet.service.ConverterService toObject
WARNING: Unable to convert a
[application/x-java-serialized-object+gwt,UTF-8] representation into
an object of class Couldn't read the GWT object representation: Too
few tokens in RPC request at
at org.restlet.ext.gwt.GwtConverter.toObject( at
at org.restlet.resource.Resource.toObject( at
at org.restlet.resource.ServerResource.doHandle(
at org.restlet.resource.ServerResource.doHandle(
at org.restlet.resource.ServerResource.doNegotiatedHandle(
at org.restlet.resource.ServerResource.doConditionalHandle(
at org.restlet.resource.ServerResource.handle(
at org.restlet.resource.Finder.handle( at
org.restlet.routing.Filter.doHandle( at
org.restlet.routing.Filter.handle( at
org.restlet.routing.Router.doHandle( at
org.restlet.routing.Router.handle( at
org.restlet.routing.Filter.doHandle( at
org.restlet.routing.Filter.handle( at
org.restlet.routing.Filter.doHandle( at
org.restlet.routing.Filter.handle( at
org.restlet.routing.Filter.doHandle( at
at org.restlet.routing.Filter.handle( at
org.restlet.routing.Filter.doHandle( at
org.restlet.routing.Filter.handle( at
org.restlet.engine.CompositeHelper.handle( at
at org.restlet.Application.handle( at
org.restlet.routing.Filter.doHandle( at
org.restlet.routing.Filter.handle( at
org.restlet.routing.Router.doHandle( at
org.restlet.routing.Router.handle( at
org.restlet.routing.Filter.doHandle( at
org.restlet.routing.Filter.handle( at
org.restlet.routing.Router.doHandle( at
org.restlet.routing.Router.handle( at
org.restlet.routing.Filter.doHandle( at
org.restlet.routing.Filter.handle( at
org.restlet.engine.CompositeHelper.handle( at
org.restlet.Component.handle( at
org.restlet.Server.handle( at
org.restlet.engine.ServerHelper.handle( at
at org.restlet.ext.servlet.ServerServlet.service(
at javax.servlet.http.HttpServlet.service( at
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at net.stax.appserver.webapp.RequestMonitorValve.invoke(
at net.stax.appserver.admin.StaxApplicationQueryValve.invoke(
at net.stax.appserver.webapp.RequestSetupValve.invoke(
at org.apache.catalina.valves.RemoteIpValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Caused by: Too few tokens
in RPC request at
at org.restlet.ext.gwt.ObjectRepresentation.getObject(
... 60 more Caused by: java.lang.IndexOutOfBoundsException: Index: 9,
Size: 9 at java.util.ArrayList.RangeCheck( at
java.util.ArrayList.get( at
... 73 more Jul 23, 2012 4:01:21 PM org.restlet.engine.log.LogFilter
afterHandle INFO: 2012-07-23 16:01:21 - 80
POST /wikeo-core/business/v2/families/ - 415 554 156 37 Mozilla/5.0
(Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.5 (KHTML, like
Gecko) Chrome/19.0.1084.56 Safari/536.5

Cyril Lakech


Dencel | 15 May 16:01 2012


I can't get my head around, why there is no filtering capability like servlet's Filter/FilterChain
available in Restlet.Is there a specific design decision at the basis for this? 

Something like: 
Authenticator authenticator = new MyAuthenticator();
Router router = new Router()

Looks more meaningful to me then: 
Authenticator authenticator = new MyAuthenticator();
authenticator = new MyAuthenticator();

In the first method there is only one filter entity created vs the two entities on the 2nd example. I've
implemented this already in my own project, but I like to know what the downside is of this approach. Imo the
only downside is there is no default Restlet API implementation of this mechanism.


Andy Dennie | 14 May 20:49 2012

setting up git repos and branches

Hi everyone,

I want to be able to occasionally submit fixes to Restlet, while maintaining local branches on my dev
machine that (a) keep up-to-date with Restlet's branches, and (b) contain my fixes, including those that
I have not yet submitted back to Restlet, and those I have submitted but which have not yet been accepted and
merged (and maybe never will be, but nevertheless I need those changes for my own use).

I'm pretty new to git, and I'd like to get off on the right foot here.

Here's what I'm thinking, please advise on whether this makes sense or if there are preferable alternatives.

As an initial setup:

- clone "" to my local dev environment
- in my local repo, create branches off each of the Restlet-defined branches, e.g. branch "my-master" from
"master", "my-2.2" from "2.2", etc.
- on github, fork restlet/restlet-framework-java to adennie/restlet-framework-java so that I have a
place to push fixes, and from which I can send pull requests to restlet/restlet-framework-java.

When I want to work on a fix, I would (in my local dev environment):

- make sure "master" is up-to-date by pulling from origin/master
- merge "master" into "my-master"
create a topic branch off "master" (e.g. "issue-123")
- when ready, push my topic branch to my forked repo on github, and submit a pull request 
- back in my local environment, merge my topic branch into "my-master", so that when building my dependent
project against "my-master", I see all my fixes.
if applicable, backport my fixes to "my-2.2" or "my-2.1" branches by cherry-picking them from
"my-master", so that I can build against a specific version of the library instead of "my-master" if I
don't want to live on the bleeding edge.

Can you guys advise my on this approach?  How do you do it?  

Thanks in advance.


izia man | 13 May 00:56 2012

code samples

I'm new in web service and rest (I'm tried to learn it myself). I want to create a program that holds a manger
that send object (or object likes) and by the input of the object the client react. I had a little research in
the web and a lot of developer recommend your project "restlet" that he so lite simple and give a very good performance.

but when I try to learn about it, it's very hard to learn.
you say a very little instruction and a small part of the code.

is there any where a full code sample and a guide  of restlet especially whit android an xstream? 

thank you
izia man


Michael Stein | 12 May 12:08 2012

How to use restlet with proxy and how to use extensions in general

Hi all, 
unfortunately I am not very familiar with restlet to be able to set up a
working project where to send a getRequest over a company proxy which needs
authentication. Without a proxy  this simple snippet works perfect:

ChallengeResponse authentication  = new
ChallengeResponse(ChallengeScheme.HTTP_BASIC, user, password);
ClientResource resource = new ClientResource(this.resourceUri);

But although I googled since some days I cannnot find a clear example on how
to use proxAuthentication. What I found is that I could use the
hhtpClient-Extension from apache for example But then the question is on who
to use this extension?? Is it necesary to use the standard methods and
classe from the httpClient lib directly? Or am I able to call everything by
the use of restlet-Api. The examples of who to use HttpClient with proxy
seems clear to me, but who does this work as part of restlet?

Thanks in advance for all replies on who to solve this. Perhaps some hints
will help.

View this message in context:
Sent from the Restlet Code mailing list archive at