title: RestEasy not working in JBoss 7.2
body: <p>I am using JBoss 7.2 and I have a empty web.xml in my application as:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I used the dependency: </p>
  
  <pre><code>         &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
              &lt;version&gt;3.0.6.Final&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>The simple application:</p>
  
  <pre><code>@ApplicationPath("/rest")
  public class JaxRsActivator extends Application {
  }
  
  @Path("/v1")
  public class RestfulService {
  
      @POST
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      @Path("/test")
      public String testAPI() {
          JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
          jsonObject.put("status", "Success");
          return jsonObject.toString();
      }
  }
  </code></pre>
  
  <p>But I get <code>HTTP 404</code> when trying <code>localhost:8080/testapplication/rest/v1/test</code>. Is there anything I am missing?</p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>I changed the <code>web.xml</code> as:</p>
  
  <pre><code>&lt;web-app version="3.0" 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"&gt;
           &lt;servlet&gt;
          &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
          &lt;servlet-class&gt;
              org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
          &lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
              &lt;param-value&gt;com.technology.apiinterface.restful.service.JaxRsActivator&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/servlet&gt;
  
              &lt;servlet-mapping&gt;
                  &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
                  &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
              &lt;/servlet-mapping&gt;
  
              &lt;context-param&gt;
                  &lt;param-name&gt;resteasy.servlet.mapping.prefix&lt;/param-name&gt;
                  &lt;param-value&gt;/rest&lt;/param-value&gt;
              &lt;/context-param&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>And changed <strong>JaxRsActivator</strong> class:</p>
  
  <pre><code>public class JaxRsActivator extends Application {
      private Set&lt;Object&gt; singletons = new HashSet&lt;Object&gt;();
      private Set&lt;Class&lt;?&gt;&gt; classes = new HashSet&lt;Class&lt;?&gt;&gt;();
  
      public JaxRsActivator() {
          singletons.add(new RestfulService());
      }
  
      @Override
      public Set&lt;Class&lt;?&gt;&gt; getClasses() {
          return classes;
      }
  
      @Override
      public Set&lt;Object&gt; getSingletons() {
          return singletons;
      }
  }
  </code></pre>
  
  <p>Now when trying <code>localhost:8080/testapplication/rest/v1/test</code>, I get following exception:</p>
  
  <pre><code>Allocate exception for servlet Resteasy: java.lang.ClassCastException: com.technology.apiinterface.restful.service.JaxRsActivator cannot be cast to javax.ws.rs.core.Application
          at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:295) [resteasy-jaxrs-3.0.6.Final.jar:]
          at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:236) [resteasy-jaxrs-3.0.6.Final.jar:]
          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112) [resteasy-jaxrs-3.0.6.Final.jar:]
          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) [resteasy-jaxrs-3.0.6.Final.jar:]
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:950) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:151) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
  </code></pre>