title: ServiceMix JAX-RS - ResourceConfig instance does not contain any root resource classes
body: <p>I have read through several of the posts with people having issues like mine, and tried several \ verified what I am doing but still no success. </p>
  
  <p>First, I am following this tutorial...<br>
  <a href="https://vzurczak.wordpress.com/2014/09/30/web-applications-with-osgi-working-with-jersey/" rel="nofollow">https://vzurczak.wordpress.com/2014/09/30/web-applications-with-osgi-working-with-jersey/</a></p>
  
  <p>But I am using ServiceMix, not Karaf. Should be similar enough though. </p>
  
  <p>My POM.XML looks like this...</p>
  
  <pre><code>&lt;project 
          xmlns="http://maven.apache.org/POM/4.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;net.vzurczak&lt;/groupId&gt;
          &lt;artifactId&gt;osgi-samples-parent&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
          &lt;relativePath&gt;../pom.xml&lt;/relativePath&gt;
      &lt;/parent&gt;
  
      &lt;groupId&gt;net.vzurczak&lt;/groupId&gt;
      &lt;artifactId&gt;rest-with-jersey-as-a-bundle&lt;/artifactId&gt;
      &lt;name&gt;OSGi Sample :: REST :: Jersey as a Bundle&lt;/name&gt;
      &lt;packaging&gt;bundle&lt;/packaging&gt;
  
      &lt;properties&gt;
          &lt;!-- 
              You need the version 1.18.1.
              1.18.0 may conflict with some OSGi containers
              (they use different and incompatible versions of ASM).
  
              This has been verified with Apache Karaf 3.0.x and Felix.
           --&gt;
          &lt;jersey.stack.version&gt;1.18.1&lt;/jersey.stack.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
              &lt;version&gt;${jersey.stack.version}&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;instructions&gt;
                          &lt;Import-Package&gt;
                              javax.ws.rs.*,
                              com.sun.jersey.api.core,
                              com.sun.jersey.spi.container.servlet
                          &lt;/Import-Package&gt;
                          &lt;Web-ContextPath&gt;rest-bundle&lt;/Web-ContextPath&gt;
                          &lt;Webapp-Context&gt;rest-bundle&lt;/Webapp-Context&gt;
                          &lt;_wab&gt;src/main/webapp&lt;/_wab&gt;
                      &lt;/instructions&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>My Web.xml looks like this...</p>
  
  <pre><code>&lt;web-app 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns="http://java.sun.com/xml/ns/javaee" 
          xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
          id="WebApp_ID" version="3.0"&gt;
  
      &lt;display-name&gt;Welcome Page&lt;/display-name&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
  
          &lt;init-param&gt;
              &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
              &lt;param-value&gt;net.vzurczak.sample.rest.internal&lt;/param-value&gt;
          &lt;/init-param&gt;
  
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;!-- 
          The web context being "rest-bundle" (check the POM),
          the REST services will found under "rest-bundle/rest/".
       --&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Trivial implementation is this:</p>
  
  <pre><code>package net.vzurczak.sample.rest.internal;
  
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.core.Response;
  
  /**
   * @author Vincent Zurczak
   */
  @Path( "/get-data" )
  public class MyRestResource {
  
      @GET
      public Response getDataToDisplay() {
          return Response.ok().entity( "Yes, it works." ).build();
      }
  }
  </code></pre>
  
  <p>Here is stack trace...</p>
  
  <pre><code>2016-07-11 14:55:13,429 | ERROR | pool-8-thread-1  | RootResourceUriRules             | ?                                   ? | 212 - com.sun.jersey.jersey-server - 1.18.1 | The ResourceConfig instance does not contain any root resource classes.
  2016-07-11 14:55:13,429 | WARN  | pool-8-thread-1  | t-with-jersey-as-a-bundle - 214} | ?                                   ? | 64 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.15.v20140411 | unavailable
  com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
      at com.sun.jersey.server.impl.application.RootResourceUriRules.&lt;init&gt;(RootResourceUriRules.java:99)[212:com.sun.jersey.jersey-server:1.18.1]
      at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1359)[212:com.sun.jersey.jersey-server:1.18.1]
      at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180)[212:com.sun.jersey.jersey-server:1.18.1]
      at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799)[212:com.sun.jersey.jersey-server:1.18.1]
      at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795)[212:com.sun.jersey.jersey-server:1.18.1]
      at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)[211:com.sun.jersey.core:1.18.1]
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795)[212:com.sun.jersey.jersey-server:1.18.1]
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790)[212:com.sun.jersey.jersey-server:1.18.1]
      at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:491)[213:com.sun.jersey.servlet:1.18.1]
      at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:321)[213:com.sun.jersey.servlet:1.18.1]
      at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)[213:com.sun.jersey.servlet:1.18.1]
      at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)[213:com.sun.jersey.servlet:1.18.1]
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:376)[213:com.sun.jersey.servlet:1.18.1]
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:559)[213:com.sun.jersey.servlet:1.18.1]
      at javax.servlet.GenericServlet.init(GenericServlet.java:161)[58:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0.0]
      at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:532)[64:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
      at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)[64:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[64:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
      at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)[64:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
      at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)[64:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
      at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)[64:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
      at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:222)[73:org.ops4j.pax.web.pax-web-jetty:3.1.2]
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[64:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
      at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:202)[73:org.ops4j.pax.web.pax-web-jetty:3.1.2]
      at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1032)[72:org.ops4j.pax.web.pax-web-runtime:3.1.2]
      at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:422)[72:org.ops4j.pax.web.pax-web-runtime:3.1.2]
      at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:341)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:678)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf.jar:2.4.1]
      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)[karaf.jar:2.4.1]
      at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf.jar:2.4.1]
      at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf.jar:2.4.1]
      at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf.jar:2.4.1]
      at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf.jar:2.4.1]
      at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[201:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_91]
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_91]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_91]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_91]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_91]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_91]
      at java.lang.Thread.run(Thread.java:745)[:1.8.0_91]
  </code></pre>
  
  <p>Thanks for any help you can provide!</p>