Thierry,
I also see this error. Please find a description below.
The example code that you provided in the ZIP didn't use router.attachDefault
AFAICS ?? and that what I (and Dennis are using) ?
Everything works fine if I use the 2.0.3 restlet JARs, but when I use the same
JARs from v2.1 I get a NoSuchMethodError exception (shown below) which occurs
on this line :-
router.attachDefault(MbHttpMockAFComBufResource.class);
where MbHttpMockAFComBufResource extends ServerResource as in :-
public class MbHttpMockAFComBufResource extends ServerResource {
... and implements the following methods (re: your comment that a cause might
be a missing method ???) :-
So somethig must be different between 2.0.3 and 2.1 ??
@Override
protected void doInit() throws ResourceException {
@Override
protected void doRelease(){
@Put("*/*")
public Representation putNonSpecificRequest(Representation entity) throws
ResourceException {
@Put("xml")
public Representation putRequestAsXML(Representation entity) throws
ResourceException {
@Put("txt")
public Representation putRequestAsText(Representation entity) throws
ResourceException {
@Override
protected Representation get(Variant variant) throws ResourceException {
@Get("xml")
public Representation getRequestAsXml() throws ResourceException {
@Get("txt")
public Representation getRequestAsText() throws ResourceException {
@Post("*/*")
public Representation postNonSpecificRequest(Representation entity) throws
ResourceException {
@Post("xml")
public Representation postRequestAsXML(Representation entity) throws
ResourceException {
@Post("txt")
public Representation postRequestAsText(Representation entity) throws
ResourceException {
03-Dec-2010 13:29:51
org.restlet.engine.log.LoggingThreadFactory$LoggingExceptionHandler
uncaughtException
SEVERE: Thread: Restlet-1606311870 terminated with exception:
org/restlet/routing/Router.attachDefault(Ljava/lang/Class;)Lorg/restlet/routing/TemplateRoute;
java.lang.NoSuchMethodError:
org/restlet/routing/Router.attachDefault(Ljava/lang/Class;)Lorg/restlet/routing/TemplateRoute;
at
com.aviva.nui.messagebroker.unittest.MbHttpMockAFComBufApplication.createInboundRoot(MbHttpMockAFComBufApplication.java:168)
at org.restlet.Application.createRoot(Application.java:204)
at org.restlet.Application.getInboundRoot(Application.java:264)
at
org.restlet.engine.application.ApplicationHelper.start(ApplicationHelper.java:92)
at org.restlet.Application.start(Application.java:592)
at org.restlet.Restlet.handle(Restlet.java:227)
at org.restlet.Application.handle(Application.java:385)
at org.restlet.Server.handle(Server.java:488)
at
org.restlet.engine.http.connector.BaseServerHelper.handle(BaseServerHelper.java:158)
at
org.restlet.engine.http.connector.BaseServerHelper.handleInbound(BaseServerHelper.java:167)
at
org.restlet.engine.http.connector.BaseHelper.handleNextInbound(BaseHelper.java:418)
at
org.restlet.engine.http.connector.Connection.readMessages(Connection.java:705)
at org.restlet.engine.http.connector.Controller$2.run(Controller.java:95)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:810)
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2687577