title: @RolesAllowed cannot be resolved with Jersey
body: <p>I am using JAX-RS using jersey implementation. I am trying to authenticate my service using BASIC authentication using Tomcat 6.</p>
  
  <p>This is the code:</p>
  
  <pre><code>@Path("/authenticate")
  @RolesAllowed({"Admin","Guest"})
  public class BasicAuthenticationSecurity {
  
  @GET
  @Path("/wbiPing")
  @Produces(MediaType.TEXT_PLAIN) 
  @RolesAllowed("Admin")
  public Response wbiPing(){
  
  System.out.println("Pinged!!!");
  return Response.ok("Pinged!!!").build();
  }
  
  }
  </code></pre>
  
  <p>When I try to annotate my method using <code>@RolesAllows</code>, I am getting an compilation error:</p>
  
  <p><code>@RolesAllows cannot be resolved to a type</code></p>
  
  <p>Please let me know how to resolve this? Any specific jars/API required for this?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;jersey-serlvet&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.security;
              com.exception
          &lt;/param-value&gt;
      &lt;/init-param&gt;       
      &lt;init-param&gt;
          &lt;param-name&gt;com.sun.jersey.spi.container.ResourceFilters&lt;/param-name&gt;
          &lt;param-value&gt;com.sun.jersey.api.container.filter.RolesAllowedResourceFilterFactory&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-serlvet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;security-constraint&gt;      
    &lt;web-resource-collection&gt;
        &lt;web-resource-name&gt;BasicDemo&lt;/web-resource-name&gt;          
        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
        &lt;http-method&gt;GET&lt;/http-method&gt;
    &lt;/web-resource-collection&gt;
    &lt;auth-constraint&gt;
        &lt;role-name&gt;Admin&lt;/role-name&gt;
    &lt;/auth-constraint&gt;
  &lt;/security-constraint&gt;
    &lt;login-config&gt;
    &lt;auth-method&gt;BASIC&lt;/auth-method&gt;
    &lt;!-- The realm name is typically displayed by the browser in the login dialog box. --&gt;
    &lt;realm-name&gt;Login&lt;/realm-name&gt;      
    &lt;/login-config&gt;
  </code></pre>
  
  <p>Please let me know about the issue.</p>