RE: Router swallowing exceptions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

RE: Router swallowing exceptions

Hi Cliff,
Do you still have the issue? If so, could you enter a bug report and attach a reproducible sample so we can figure out what is wrong?
Best regards,
Jérôme Louvel
Restlet ~ Founder and Lead developer ~
Noelios Technologies ~ Co-founder ~

De : Cliff Binstock [mailto:[hidden email]]
Envoyé : mardi 28 octobre 2008 18:56
À : [hidden email]
Objet : RE: Router swallowing exceptions

I am using V1.1 RC2


Cliff Binstock

From: Thierry Boileau [mailto:[hidden email]]
Sent: Tuesday, October 28, 2008 2:33 AM
To: [hidden email]
Subject: Re: Router swallowing exceptions


Hello Cliff,

I get an Instantiation exception with a warning trace when running with the current trunk.

ATTENTION: Exception while instantiating the target handler.
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(
    at java.lang.reflect.Constructor.newInstance(
    at org.restlet.Finder.createTarget(

What release of Restlet are you using?

Best regards,
Thierry Boileau
Restlet ~ Core developer ~
Noelios Technologies ~ Co-founder ~

I unfortunately accidentally discovered that if a “Resource” is not instantiable (e.g., the class is abstract, constructor is protected, etc.), the router—which is unable to complete its work—does “nothing” and doesn’t log anything either

It would be most appreciated if it would log a (probably SEVERE) error if it was unable to instantiate the Resource.


For example, if you have this:


        attach(router, "/not-instantiable", com.example.resource.MyAbstractResource.class);


and of course:


package com.example.resource;

public abstract class MyAbstractResource

    extends Resource {




Thanks much,


Cliff Binstock

Coyote Reporting