title: enabling auto scanning using resteasy 3.0.10 with wildfly 8.2
body: <p>I am trying to figure out what is my problem while setting up new Wildfly 8.2 server with simple restEasy 3.0.10 application.</p>
  
  <p>my web application is supre easy. </p>
  
  <pre><code>src/main/
     java/my-package/
        RootApplication.java
        HomePageResource.java
     webapp/
        index.html
        WEB-INF/
           beans.xml
           web.xml
  </code></pre>
  
  <p>web.xml and beans.xml look like this</p>
  
  <pre><code>---- web.xml
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.1"
           xmlns="http://xmlns.jcp.org/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
           metadata-complete="false"&gt;
  &lt;/web-app&gt;
  ---- beans.xml
  &lt;beans 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/beans_1_0.xsd"&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>in RootApplication.java I have</p>
  
  <pre><code>@ApplicationPath("/app")
  public class RootApplication extends Application
  {
      private Set&lt;Object&gt; singletons = new HashSet&lt;&gt;();
  
      public RootApplication()
      {
          singletons.add(new HomePageResource());
      }
  
      @Override
      public Set&lt;Object&gt; getSingletons()
      {
          return singletons;
      }
  }
  
  // ResourceProvider is a simple class hiding getResource and createStreamer
  @Path("/")
  public class HomePageResource extends ResourceProvider
  {
      private final static Logger logger = LoggerFactory.getLogger(HomePageResource.class);
  
      @GET
      @Produces(MediaType.TEXT_HTML)
      public Response getHomePage()
      {
          final InputStream homePageResource = getResource("/static/view/home/home.html");
          return Response.ok(createStreamer(homePageResource)).build();
      }
  }
  </code></pre>
  
  <p>which works but I have never specified any resource classes inside Application and RestEasy was always able to scan WAR content. And if I remove everything from RootApplication, like this.</p>
  
  <pre><code>@ApplicationPath("/app")
  public class RootApplication extends Application
  {
  }
  </code></pre>
  
  <p>Anyway documentation also says (<a href="https://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html_single/" rel="noreferrer">https://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html_single/</a>) </p>
  
  <blockquote>
    <p>Since we're not using a jax-rs servlet mapping, we must define an Application class that is annotated with the @ApplicationPath annotation. <strong>If you return any empty set for by classes and singletons, your WAR will be scanned for JAX-RS annotation resource and provider classes.</strong></p>
  </blockquote>
  
  <p>any hints what I may do wrong with this simple setup??? and another question can I remove beans.xml to use guice DI, I understand this problem has nothing to do with CDI/WELD.</p>
  
  <p>my pom.xml looks like this</p>
  
  <pre><code>&lt;dependencyManagement&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-bom&lt;/artifactId&gt;
              &lt;version&gt;3.0.10&lt;/version&gt;
              &lt;type&gt;pom&lt;/type&gt;
              &lt;scope&gt;import&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
          &lt;artifactId&gt;jaxrs-api&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
          &lt;artifactId&gt;resteasy-jackson-provider&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
          &lt;artifactId&gt;resteasy-multipart-provider&lt;/artifactId&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>