title: 404 when accessing Jersey app in Tomcat 7
body: <p>I am a newby in web development and I am struggling to create a simple rest web service using jersey, packed as an independent war file, to be deployed on tomcat 7.</p>
  
  <p><a href="http://www-inf.it-sudparis.eu/~nguyen_n/teaching_assistant/web_services/jersey_helloworld" rel="nofollow">I have followed this tutorial</a> in order to create simple hello world restful web service.
  I have used intelij in order to create the war file (both war file and exploded version of it) and deployed them on the tomcat\webapps folder.</p>
  
  <p>When starting up the tomcat, I fail to access the url (<code>http://localhost:8080/rest/hello</code>)  - getting 404.</p>
  
  <p>Looking at the tomcat's logs, I can't find any exception or error, other then these next set of lines:</p>
  
  <pre><code>INFO: Scanning for root resource and provider classes in the packages:
    sample
  εαΘ 30, 2013 11:24:38 PM com.sun.jersey.api.core.ScanningResourceConfig logClasses
  INFO: Root resource classes found:
    class sample.Hello
  εαΘ 30, 2013 11:24:38 PM com.sun.jersey.api.core.ScanningResourceConfig init
  INFO: No provider classes found.
  </code></pre>
  
  <p>I have searched it a lot and tried to follow all solutions for this error but nothing worked.</p>
  
  <p>I have the feeling that I missing something very basic, due to my newbi'ness. 
  Any ideas what to search ? what am I missing ?
  it's a simple hello world app and I am exahuster and frustrated...</p>
  
  <p><strong>Java class</strong></p>
  
  <pre><code>package sample;
  
  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 requested
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String sayHelloInPlainText() {
      return "Hello world!";
    }
  
    // This method is called if HTML is requested
    @GET
    @Produces(MediaType.TEXT_HTML)
    public String sayHelloInHtml() {
      return "&lt;html&gt; " + "&lt;title&gt;" + "Hello world!" + "&lt;/title&gt;"
          + "&lt;body&gt;&lt;h1&gt;" + "Hello world!" + "&lt;/body&gt;&lt;/h1&gt;" + "&lt;/html&gt; ";
    }
  }
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &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;rest&lt;/display-name&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;sample&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;/*&lt;/url-pattern&gt;
        &lt;/servlet-mapping&gt;
  
      &lt;/web-app&gt;
  </code></pre>