title: Jboss error: The ResourceConfig instance does not contain any root resource classes
body: <p>I know this is a general question and it is already answered but those answers are not helping for this case.</p>
  
  <p>I am getting this error in <strong>only</strong> Jboss7.1 final release not in Tomcat(working fine with tomcat version 7) (checked with the same WAR file)</p>
  
  <pre><code>com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
  com.sun.jersey.server.impl.application.RootResourceUriRules.&lt;init&gt;(RootResourceUriRules.java:99)
  com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1300)
  com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:163)
  </code></pre>
  
  <h2>web.xml</h2>
  
  <pre><code>&lt;display-name&gt;myj2ee.app&lt;/display-name&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;jersey-serlvet&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;myj2ee.app&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;jersey-serlvet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>
  
  <h2>pom.xml</h2>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.spec&lt;/groupId&gt;
          &lt;artifactId&gt;jboss-javaee-6.0&lt;/artifactId&gt;
          &lt;version&gt;1.0.0.Final&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-servlet&lt;/artifactId&gt;
          &lt;version&gt;1.14&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
          &lt;version&gt;1.14&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <h2>REST Resource class</h2>
  
  <pre><code>@Path("/hello")
  public class HelloWorldService {
  
      @GET
      @Path("/{param}")
      public Response getMsg(@PathParam("param") String msg) { 
          String output = "Jersey say : " + msg; 
          return Response.status(200).entity(output).build(); 
      }
  
  }
  </code></pre>
  
  <p><strong>Note:</strong><br>
  I have removed the Restlet from Jboss.as standalone config otherwise it gives different error.</p>