title: JAX-RS in Glassfish path selection not working
body: <p>Glassfish 4, very simple application. I'm using Kepler, created a dynamic Web service project using Glassfish 4 as the server, allowed Eclipse to generate web.xml and glassfish-web.xml. The context names is /calls.</p>
  
  <p>Application</p>
  
  <pre><code>package com.deltacontractservices.calls.service;
  
  import java.util.HashSet;
  import java.util.Set;
  
  import javax.ws.rs.ApplicationPath;
  import javax.ws.rs.core.Application;
  
  @ApplicationPath("/rest/*")
  public class CallsApplication extends Application
  {
      @Override
      public Set&lt;Class&lt;?&gt;&gt; getClasses()
      {
          final Set&lt;Class&lt;?&gt;&gt; classes = new HashSet&lt;Class&lt;?&gt;&gt;();
  
          classes.add(Controller.class);
  
          return classes;
      }
  }
  </code></pre>
  
  <p>Resource</p>
  
  <pre><code>package com.deltacontractservices.calls.service;
  
  import javax.enterprise.context.ApplicationScoped;
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.Produces;
  import javax.ws.rs.core.MediaType;
  
  /**
   * This class implements a JAX-RS service controller for the Calls API
   */
  @ApplicationScoped
  @Path("/rest")
  public class Controller
  {
  
      @GET
      @Produces(MediaType.TEXT_PLAIN)
      public String base()
      {
          return "Calls application default.";
      }
  
      @GET
      @Path("ping")
      @Produces(MediaType.TEXT_PLAIN)
      public String ping()
      {
          return "Calls application ping.";
      }
  }
  </code></pre>
  
  <p>http: //localhost:8080/calls/rest produces "Calls application default". Good.</p>
  
  <p>http: //localhost:8080/calls/rest/ produces 404.</p>
  
  <p>http: //localhost:8080/calls/rest/ping produces 404.</p>
  
  <p>I must be missing something obvious. Help please...</p>