title: Error 404 - The requested resource is not available- Eclipse Tomcat7
body: <p>I am running my project with TomCat7 with Eclipse under UBUNTU
  I am trying to follow a tutorial online to create a RESTful api. I follow exactly the same steps, but I get the 404 error when I try to run the project.</p>
  
  <p>Here is my .class file that is in the src folder</p>
  
  <pre><code>package com.eviac.blog.restws;
  
  
  
  
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.PathParam;
  import javax.ws.rs.Produces;
  import javax.ws.rs.core.MediaType;
  
  
  
  
  /**
  * 
  * @author pavithra
  * 
  */
  
  
  
  
  // @Path here defines class level path. Identifies the URI path that 
  // a resource class will serve requests for.
  @Path("UserInfoService")
  public class UserInfo {
  
  
  
  
  // @GET here defines, this method will method will process HTTP GET
  // requests.
  @GET
  // @Path here defines method level path. Identifies the URI path that a
  // resource class method will serve requests for.
  @Path("/name/{i}")
  // @Produces here defines the media type(s) that the methods
  // of a resource class can produce.
  @Produces(MediaType.TEXT_XML)
  // @PathParam injects the value of URI parameter that defined in @Path
  // expression, into the method.
  public String userName(@PathParam("i") String i) {
  
  
  
  
  String name = i;
  return "&lt;User&gt;" + "&lt;Name&gt;" + name + "&lt;/Name&gt;" + "&lt;/User&gt;";
  }
  
  
  
  
  @GET 
  @Path("/age/{j}") 
  @Produces(MediaType.TEXT_XML)
  public String userAge(@PathParam("j") int j) {
  
  
  
  
  int age = j;
  return "&lt;User&gt;" + "&lt;Age&gt;" + age + "&lt;/Age&gt;" + "&lt;/User&gt;";
  }
  }
  </code></pre>
  
  <p>And this is web.xml that is in WEB-INF -> lib</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; 
  &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"&gt;
  &lt;display-name&gt;RESTfulWS&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;com.eviac.blog.restws&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>When I try to access this from localhost, I get the error..</p>
  
  <blockquote>
    <p>The requested resource (/RESTfulWS/) is not available.</p>
  </blockquote>