Good point. I've entered an issue to reduce the depth of the stack trace: http://restlet.tigris.org/issues/show_bug.cgi?id=190
Best regards, Jerome > -----Message d'origine----- > De : Dave Pawson [mailto:[EMAIL PROTECTED] > Envoyé : jeudi 9 novembre 2006 11:11 > À : [email protected] > Objet : Re: tutorial examples. > > On 09/11/06, Dave Pawson <[EMAIL PROTECTED]> wrote: > > > Tutorial, section 6 > > > > @Override > > public Restlet createRoot() > > { > > return new Directory(getContext(), ROOT_URI); > > } > > }; > > > > No mention of ROOT_URI in the text ? > > Guessing how it should be used I'm getting the error below > (quite impressive!) > > I have a file in /files/endpoint/index.html > > my code reads > > public void serve(){ > > // Create a container > Container container = new Container(); > container.getServers().add(Protocol.HTTP, 8182); > //container.getClients().add(Protocol.FILE); > > // Create an application > Application application = new Application(container) { > @Override > public Restlet createRoot() { > return new Directory(getContext(), > "/files/endpoint/index.html"); > } > }; > > // Attach the application to the container and start it > container.getDefaultHost().attach("/endpoint", application); > try { > container.start(); > } catch (Exception ex) { > System.err.println("Start error "+ ex.toString()); > ex.printStackTrace(); > } > > } > > > Error reported. > > > 2006-11-09 10:08:49.829::INFO: Logging to STDERR via > org.mortbay.log.StdErrLog > 2006-11-09 10:08:49.891::INFO: jetty-6.0.x > 2006-11-09 10:08:50.016::INFO: Started > SelectChannelConnector @ 0.0.0.0:8182 > Returned from t.srvr() > 09-Nov-2006 10:09:15 com.noelios.restlet.StatusFilter doHandle > SEVERE: Unhandled exception or error intercepted > java.lang.UnsupportedOperationException: Unable to determine the > protocol to use for this call. > at > com.noelios.restlet.application.ApplicationDispatcher.handle(A > pplicationDispatcher.java:66) > at org.restlet.Dispatcher.handle(Dispatcher.java:51) > at org.restlet.Dispatcher.get(Dispatcher.java:72) > at > com.noelios.restlet.local.DirectoryResource.<init>(DirectoryRe > source.java:130) > at > com.noelios.restlet.Factory.createDirectoryResource(Factory.java:228) > at org.restlet.Directory.findTarget(Directory.java:99) > at org.restlet.Handler.handleGet(Handler.java:250) > at org.restlet.Handler.handle(Handler.java:147) > at org.restlet.Chainer.handle(Chainer.java:66) > at org.restlet.Filter.doHandle(Filter.java:140) > at org.restlet.Filter.handle(Filter.java:118) > at org.restlet.Chainer.handle(Chainer.java:66) > at org.restlet.Filter.doHandle(Filter.java:140) > at > com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:81) > at org.restlet.Filter.handle(Filter.java:118) > at org.restlet.Chainer.handle(Chainer.java:66) > at org.restlet.Filter.doHandle(Filter.java:140) > at org.restlet.Filter.handle(Filter.java:118) > at org.restlet.Chainer.handle(Chainer.java:66) > at org.restlet.Filter.doHandle(Filter.java:140) > at org.restlet.Filter.handle(Filter.java:118) > at > com.noelios.restlet.application.ApplicationHelper.handle(Appli > cationHelper.java:100) > at org.restlet.Application.handle(Application.java:275) > at org.restlet.Chainer.handle(Chainer.java:66) > at org.restlet.Filter.doHandle(Filter.java:140) > at org.restlet.Filter.handle(Filter.java:118) > at org.restlet.Chainer.handle(Chainer.java:66) > at org.restlet.Chainer.handle(Chainer.java:66) > at org.restlet.Filter.doHandle(Filter.java:140) > at org.restlet.Filter.handle(Filter.java:118) > at org.restlet.Chainer.handle(Chainer.java:66) > at org.restlet.Chainer.handle(Chainer.java:66) > at org.restlet.Filter.doHandle(Filter.java:140) > at > com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:81) > at org.restlet.Filter.handle(Filter.java:118) > at > com.noelios.restlet.container.ContainerHelper.handle(Container > Helper.java:113) > at org.restlet.Container.handle(Container.java:134) > at org.restlet.Server.handle(Server.java:185) > at > com.noelios.restlet.ServerHelper.handle(ServerHelper.java:96) > at > com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHel > per.java:87) > at > com.noelios.restlet.ext.jetty.JettyServerHelper$WrappedServer. > handle(JettyServerHelper.java:228) > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection. > java:430) > at > org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete > (HttpConnection.java:687) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492) > at > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199) > at > org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339) > at > org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPo > int.java:270) > at > org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThr > eadPool.java:475) > 09-Nov-2006 10:09:15 com.noelios.restlet.LogFilter afterHandle > INFO: 2006-11-09 10:09:15 GET /endpoint > - 127.0.0.1 - Mozilla/5.0 > (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.8) Gecko/20061025 > Firefox/1.5.0.8 - 500 366 - > http://localhost:8182 109 > > > > regards > > -- > Dave Pawson > XSLT XSL-FO FAQ. > http://www.dpawson.co.uk

