title: Hadoop in a RESTful Java Web Application - Conflicting URI templates
body: <p>I have a small Java Web Application in which I am using Jersey 1.12 and the Hadoop 1.0.0 JAR file (hadoop-core-1.0.0.jar).  When I deploy my application to my JBoss 5.0 server, the log file records the following error:</p>
  
  <pre><code>SEVERE: Conflicting URI templates. The URI template / for root resource class   
  org.apache.hadoop.hdfs.server.namenode.web.resources.NamenodeWebHdfsMethods and the URI  
  template / transform to the same regular expression (/.*)?
  </code></pre>
  
  <p>To make sure my code is not the problem, I have created a fresh web application that contains nothing but the Jersey and Hadoop JAR files along with a small stub. My web.xml is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" 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_2_5.xsd"&gt;
     &lt;servlet&gt;
      &lt;servlet-name&gt;ServletAdaptor&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-  class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
     &lt;/servlet&gt;
     &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;ServletAdaptor&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/mytest/*&lt;/url-pattern&gt;
     &lt;/servlet-mapping&gt;    
     &lt;session-config&gt;
      &lt;session-timeout&gt;
          30
      &lt;/session-timeout&gt;
     &lt;/session-config&gt;
     &lt;welcome-file-list&gt;
        &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
     &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>My simple RESTful stub is as follows:</p>
  
  <pre><code>import javax.ws.rs.core.Context;
  import javax.ws.rs.core.UriInfo;
  import javax.ws.rs.Path;
  
  @Path("/mytest")
  public class MyRest {
  
  @Context
  private UriInfo context;
  
    public MyRest() {
    }
  }
  </code></pre>
  
  <p>In my regular application, when I remove the Hadoop JAR files (and the code that is using Hadoop), everything works as I would expect.  The deployment is successful and the remaining RESTful services work. I have also tried the Hadoop 1.0.1 JAR files and have had the same problems with the conflicting URL template in the NamenodeWebHdfsMethods class. Any suggestions or tips in solving this problem would be greatly appreciated. </p>