title: Disable default search of rest services in JBoss EAP 6.3
body: <p>I need to disable default rest easy search in JBoss EAP 6.3.
  I need to deploy the same EAR in JBoss as well as weblogic and websphere, hence cannot make changes in web.xml that is specific to JBoss.</p>
  
  <p>Java Class:</p>
  
  <pre><code>package com.first;
  
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.Produces;
  import javax.ws.rs.core.MediaType;
  
  @Path("/hello")
  public class Hello {
  
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String sayPlainTextHello() {
      return "Hello sayPlainTextHello";
    }
  
  
    @GET
    @Produces(MediaType.TEXT_XML)
    public String sayXMLHello() {
      return "&lt;?xml version=\"1.0\"?&gt;" + "&lt;hello&gt; Hello sayXMLHello" + "&lt;/hello&gt;";
    }
  
    @GET
    @Produces(MediaType.TEXT_HTML)
    public String sayHtmlHello() {
      return "&lt;html&gt; " + "&lt;title&gt;" + "Hello sayHtmlHello" + "&lt;/title&gt;"
          + "&lt;body&gt;&lt;h1&gt;" + "Hello String" + "&lt;/body&gt;&lt;/h1&gt;" + "&lt;/html&gt; ";
    }
  
  } 
  </code></pre>
  
  <p>Web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;com.first&lt;/display-name&gt;
   &lt;servlet&gt;
      &lt;servlet-name&gt;Jersey REST Service&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.first&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 REST Service&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.scan&lt;/param-name&gt;
      &lt;param-value&gt;false&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;resteasy.scan.providers&lt;/param-name&gt;
      &lt;param-value&gt;false&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;resteasy.scan.resources&lt;/param-name&gt;
      &lt;param-value&gt;false&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;/web-app&gt; 
  </code></pre>
  
  <p>jboss-deployment-structure.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"&gt;
      &lt;deployment&gt;
          &lt;exclude-subsystems&gt;
              &lt;!-- Disable the default JAX-RS subsystem --&gt;
              &lt;subsystem name="jaxrs" /&gt;
          &lt;/exclude-subsystems&gt;
  
      &lt;/deployment&gt;
  &lt;/jboss-deployment-structure&gt;
  </code></pre>
  
  <p>This throws an error: The ResourceConfig instance does not contain any root resource classes.</p>
  
  <p>If I remove below lines from web.xml, it works fine:</p>
  
  <pre><code>&lt;init-param&gt;
      &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
      &lt;param-value&gt;com.first&lt;/param-value&gt;
  &lt;/init-param&gt;
  </code></pre>
  
  <p>Can anyone please suggest me what should be the ideal approach without making changes in web.xml(ideally it should work in all servers)</p>
  
  <p>Thanks</p>