title: Java Restful API..The requested resource is not available
body: <p>I am trying to work with Java Restful Api..But when i run the application the server send back Resource not found..I try hard But i cann't solve that..I use Eclipse IDE And Tomcat 7 server.</p>
  
  <p>................Web.Xml file.....................</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" 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;RestfullAndAngularJSTest&lt;/display-name&gt;
  &lt;welcome-file-list&gt;
  &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
  &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
  &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
  &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
  &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>...........Product.java file.....................</p>
  
  <pre><code>package entities;
  
  import java.io.*;
  import javax.xml.bind.annotation.*;;
  
  @XmlRootElement(name = "product")
  public class Product implements Serializable {
      private String id;
      private String name;
      private double price;
  
      @XmlElement
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      @XmlElement
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      @XmlElement
      public double getPrice() {
          return price;
      }
  
      public void setPrice(double price) {
          this.price = price;
      }
  
      public Product(String id, String name, double price) {
          super();
          this.id = id;
          this.name = name;
          this.price = price;
      }
  
      public Product() {
  
      }
  
  }
  </code></pre>
  
  <p>...........ApplicationConfig.java file....................</p>
  
  <pre><code>package productWS;
  
  import java.util.Set;
  
  import javax.ws.rs.core.Application;
  
  @javax.ws.rs.ApplicationPath("rest")
  public class ApplicationConfig extends Application {
  
      @Override
      public Set&lt;Class&lt;?&gt;&gt; getClasses() {
          Set&lt;Class&lt;?&gt;&gt; resources = new java.util.HashSet&lt;&gt;();
          addRestResourceClasses(resources);
          return resources;
      }
  
      private void addRestResourceClasses(Set&lt;Class&lt;?&gt;&gt; resources) {
          resources.add(productWS.ProductRestFull.class);
      }
  
  }
  </code></pre>
  
  <p>.........ProductRestFull.java file......</p>
  
  <pre><code>package productWS;
  
  import javax.ws.rs.*;
  import javax.ws.rs.core.MediaType;
  
  import java.util.*;
  import entities.*;
  
  @Path("product")
  public class ProductRestFull {
      @GET
      @Path("findall")
      @Produces(MediaType.APPLICATION_JSON)
      public List&lt;Product&gt; findAll() {
          List&lt;Product&gt; result = new ArrayList&lt;Product&gt;();
          result.add(new Product("P01", "Name1", 1000.00));
          result.add(new Product("P02", "Name2", 1050.00));
          result.add(new Product("P01", "Name3", 2000.00));
          result.add(new Product("P01", "Name4", 3000.00));
          return result;
      }
  }
  </code></pre>
  
  <p>This is the     URL:<a href="http://localhost:8080/RestfullAndAngularJSTest/rest/product/findall" rel="nofollow">http://localhost:8080/RestfullAndAngularJSTest/rest/product/findall</a></p>