RE: Router swallowing exceptions

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

RE: Router swallowing exceptions

jlouvel
Administrator
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 ~
http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


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.
java.lang.InstantiationException
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at org.restlet.Finder.createTarget(Finder.java:186)
[...]

What release of Restlet are you using?

Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~
http://www.noelios.com


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

Loading...