title: No Idea why : The ResourceConfig instance does not contain any root resource classes
body: <p>I'm new to jersey and web services and I'm try to run a simple RESTful web service. I followed <a href="http://www.mkyong.com/webservices/jax-rs/jersey-hello-world-example/" rel="noreferrer">http://www.mkyong.com/webservices/jax-rs/jersey-hello-world-example/</a> but my project doesn't use maven and I download the jersey.1.17.1.jar and include it to my project path.</p>
  
  <p>When I want to call the service on <code>http://localhost:8080/sycotext/rest/service/SOMETEXT</code> I get this error : </p>
  
  <pre><code>HTTP Status 500 - Servlet.init() for servlet sycoText-servlet threw exception
  </code></pre>
  
  <p>this is the stack trace : </p>
  
  <pre><code>javax.servlet.ServletException: Servlet.init() for servlet sycoText-servlet threw exception
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:76)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:934)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:515)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1010)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640)
      org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1618)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1576)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      java.lang.Thread.run(Thread.java:724)
  
  root cause
  
  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:1331)
      com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:168)
      com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:774)
      com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:770)
      com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
      com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:770)
      com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:765)
      com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:489)
      com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:319)
      com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)
      com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
      com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374)
      com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557)
      javax.servlet.GenericServlet.init(GenericServlet.java:160)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:76)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:934)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:515)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1010)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640)
      org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1618)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1576)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      java.lang.Thread.run(Thread.java:724)
  </code></pre>
  
  <p>here is my code :</p>
  
  <pre><code>package ir.sycotech.text.server.service;
  
  import javax.ws.rs.*;
  import javax.ws.rs.core.Response;
  
  @Path("/service")
  public class SycoTextService {
      @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>and here is my web.xml : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="WebApp_ID" version="2.4"
           xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
  
      &lt;display-name&gt;Restful Web Application&lt;/display-name&gt;
  
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;sycoText-servlet&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;ir.sycotech.text.server.service&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;sycoText-servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I have specified my packagename correctly in the web.xml file and I don't know why I got this error, I will be really appreciate if anyone knows what is the problem</p>