Integrating jersey with nanoHTTPD

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

Integrating jersey with nanoHTTPD

Daniel Santos

I am trying to pass HTTP requests from a nano HTTP web server to a Jersey ApplicationHandler. The way I create the application handler is shown below :

ResourceConfig app = new ResourceConfig();
ApplicationHandler newHandler = new ApplicationHandler(app);
Where instances is an array of POJO's annotated with the jersey annotations representing resources.

On each request received by the webserver I am calling the following code :

ContainerRequest request = new ContainerRequest(new URI(contextPath), new URI(relativePath), session.getMethod().toString(), secContext, propertiesDelegate);
Future<ContainerResponse> responseFuture = handler.apply(request);
ContainerResponse response = responseFuture.get();
Object entity = response.getEntity();
This code always results in a NotFound. I have stepped into it and can see that the only routings available are for the application.wadl urls

What am I missing ?