Sorry... forgot to post my TestApplication.
Cheers,
Dave
package restlet;
import org.restlet.Application;
import org.restlet.Context;
import org.restlet.Directory;
import org.restlet.Restlet;
public class TestApplication
extends Application
{
public TestApplication()
{
super();
}
public TestApplication( final Context context )
{
super( context );
}
@Override
public Restlet createRoot()
{
return new Directory( getContext(), "file:///home/docs" );
}
}
On Wed, 2007-08-15 at 15:40 +0900, David Leangen wrote:
> Hello,
>
> I am trying to get Restlet up and running in my OSGi container, using
> HttpService.
>
> I created a TestApplication [1].
>
> I registered it like so:
>
> servlet = new ServerServlet();
> initParams.put( "org.restlet.application", "restlet.TestApplication" );
> httpService.registerServlet( "/restlet", servlet, initParams, null );
>
> And tried accessing the URL at localhost:8080 (the port on which my osgi
> is registered).
>
> However, I get the error below.
>
>
> Any helpful hints would be most appreciated!
>
>
>
>
> 15:02:44.600 WARN!! Exception for /restlet/testFile
> javax.servlet.ServletException: non-HTTP request or response
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:800)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)
> at
> org.mortbay.jetty.servlet.OsgiServletHandler.dispatch(OsgiServletHandler.java:108)
> at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
> at org.mortbay.http.HttpServer.service(HttpServer.java:879)
> at org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:961)
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
> at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:218)
> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:300)
> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:511)
>
>