Hi, you need to make sure you're using the "WebContainer" HTTP-Service, it's the one provided by Pax-Web. Take also a look at the samples of Pax-Web[1].
Another way of registering your resources might be to use the whiteboard mechanism. Greetings, Achim [1] - https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/helloworld-wc/src/main/java/org/ops4j/pax/web/samples/helloworld/wc/internal/Activator.java#L122 2013/5/4 Clement Jebakumar <jeba.r...@gmail.com> > > Hi, > > I have a bundle which supplies css/img folder. I tried with below code, > looks like jetty is not recognizing it. How to enable files in those > folders be served by Jetty > > ServiceReference sRef = context.getServiceReference(HttpService.class > .getName()); > HttpService service = (HttpService) context.getService(sRef); > service.registerResources("/", "/htmls", null); > // service.registerResources("/js", "js", null); > String webDir = getClass().getClassLoader().getResource("css") > .toExternalForm(); > service.registerResources("/css", webDir, null); > service.registerResources("/img", "/img", null); > > Files are put insider bundle. In eclipse devlopment, we have an unpack > option which solved the issue in Eclipse. But in karaf, i am not sure how > to make jetty to work with this. > > > *Clement Jebakumar,* > > 111/27 Keelamutharamman Kovil Street, > Tenkasi, 627 811 > http://www.declum.com/clement.html > > -- Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project Lead blog <http://notizblog.nierbeck.de/>