title: Loading resources using Jersey and @ApplicationPath annotation
body: <p>I'm trying to deploy a basic jersey restful service to Tomcat7 without web.xml:</p>
  
  <pre><code> @WebServlet(loadOnStartup=1)
   @ApplicationPath("resources")
   @Path("/mypath/{name}")
   public class MyResource extends Application {
  
   @Override
   public Set&lt;Class&lt;?&gt;&gt; getClasses() {
       Set&lt;Class&lt;?&gt;&gt; s = new HashSet&lt;Class&lt;?&gt;&gt;();
       s.add(MyResource.class);
       return s;
   }
  
   @GET
   @Consumes("text/plain")
   @Produces("text/plain")
   public String getWelcome(@PathParam(value = "name") String name) {
       return "Welcome to jax-rs " + name;
   }
  }
  </code></pre>
  
  <p>I'm presented with a 404 when trying to access: <em>/myapplication/resources/mypath/sample</em>.</p>
  
  <p>I can deploy a servlet using the <code>@WebServlet</code> annotation, so this has nothing to do with the loading of servlets without web.xml into Tomcat7.</p>
  
  <p>From reading the documentation for Jersey, the runtime should scan for classes extending <code>Application</code> and execute <code>getClasses()</code>, loading all root resources.</p>