title: jersey rest issues
body: <p>I always end up with the "The ResourceConfig instance does not contain any root resource classes" error</p>
  
  <p>I shouldn't even need anything other then jersey-bundle
  but without it I get errors regarding the asm.jar</p>
  
  <pre><code>package akiraapps.jerseytest;
  
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.Produces;
  import javax.ws.rs.core.MediaType;
  
  @Path("/hello")
  public class Hello {
  
      // This method is called if TEXT_PLAIN is request
      @GET
      @Produces(MediaType.TEXT_PLAIN)
      public String sayPlainTextHello() {
          return "Hello Jersey";
      }
  
      // This method is called if XML is request
      @GET
      @Produces(MediaType.TEXT_XML)
      public String sayXMLHello() {
          return "&lt;?xml version=\"1.0\"?&gt;" + "&lt;hello&gt; Hello Jersey" + "&lt;/hello&gt;";
      }
  
      // This method is called if HTML is request
      @GET
      @Produces(MediaType.TEXT_HTML)
      public String sayHtmlHello() {
          return "&lt;html&gt; " + "&lt;title&gt;" + "Hello Jersey" + "&lt;/title&gt;"
                  + "&lt;body&gt;&lt;h1&gt;" + "Hello Jersey" + "&lt;/body&gt;&lt;/h1&gt;" + "&lt;/html&gt; ";
      }
  
  
  }
  </code></pre>
  
  <p>WEB.XML------</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_2_5.xsd" id="WebApp_ID" version="2.5"&gt;
   &lt;servlet&gt; 
      &lt;servlet-name&gt;Jersey REST Service&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;akiraapps.jerseytest&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 REST Service&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/0X4cv.png" alt="classpath"></p>
  
  <p>ERROR LOG:</p>
  
  <blockquote>
    <p>Jun 16, 2011 11:54:03 AM
    com.sun.jersey.api.core.PackagesResourceConfig
    init INFO: Scanning for root resource
    and provider classes in the packages: 
    akiraapps.jerseytest.Hello Jun 16,
    2011 11:54:03 AM
    com.sun.jersey.server.impl.application.WebApplicationImpl
    _initiate INFO: Initiating Jersey application, version 'Jersey: 1.7
    05/20/2011 11:43 AM' Jun 16, 2011
    11:54:03 AM
    com.sun.jersey.server.impl.application.RootResourceUriRules
     SEVERE: The ResourceConfig
    instance does not contain any root
    resource classes. Jun 16, 2011
    11:54:03 AM
    org.apache.catalina.core.ApplicationContext
    log SEVERE: StandardWrapper.Throwable
    com.sun.jersey.api.container.ContainerException:
    The ResourceConfig instance does not
    contain any root resource classes.    at
    com.sun.jersey.server.impl.application.RootResourceUriRules.(RootResourceUriRules.java:99)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1298)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:167)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:773)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:769)
      at
    com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:769)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:764)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
      at
    com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
      at
    com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
      at
    javax.servlet.GenericServlet.init(GenericServlet.java:160)
      at
    org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1189)
      at
    org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1103)
      at
    org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:813)
      at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
      at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
      at
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
      at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
      at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
      at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
      at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
      at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
      at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
      at
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at
    java.lang.Thread.run(Thread.java:662)
    Jun 16, 2011 11:54:03 AM
    org.apache.catalina.core.StandardWrapperValve
    invoke SEVERE: Allocate exception for
    servlet Jersey REST Service
    com.sun.jersey.api.container.ContainerException:
    The ResourceConfig instance does not
    contain any root resource classes.    at
    com.sun.jersey.server.impl.application.RootResourceUriRules.(RootResourceUriRules.java:99)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1298)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:167)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:773)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:769)
      at
    com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:769)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:764)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
      at
    com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
      at
    com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
      at
    javax.servlet.GenericServlet.init(GenericServlet.java:160)
      at
    org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1189)
      at
    org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1103)
      at
    org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:813)
      at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
      at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
      at
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
      at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
      at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
      at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
      at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
      at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
      at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
      at
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at
    java.lang.Thread.run(Thread.java:662)</p>
  </blockquote>