title: Why tomcat7 can't read my context.xml?
body: <p>I'm trying to integrate apache solr4.5 with tomcat7.0.</p>
  
  <p>Here is my prob, I make a directory named "solr" under $CATALINA_BASE/webapps, and create an context.xml under the path, which the directory structure looks like.</p>
  
  <p><strong>$CATALINA_BASE/webapps/solr/META-INF/context.xml</strong></p>
  
  <p>The context.xml looks like as follow:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;Context docBase="/solr/home/root/solr.war"&gt;
       &lt;Environment name="solr/home" type="java.lang.String" value="/solr/home/root" /&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>I was expecting when I visit "localhost:8080/solr/", the solr webapp should work fine, but what I got is some errors like this:</p>
  
  <pre><code>HTTP Status 404 - /solr/
  
  type Status report
  
  message /solr/
  
  description The requested resource (/solr/) is not available.
  
  Apache Tomcat/7.0.26
  </code></pre>
  
  <p>But according to the apache tomcat7.0 document,</p>
  
  <blockquote>
    <p>Individual Context elements may be explicitly defined:</p>
    
    <ol>
    <li><p>In an individual file at /META-INF/context.xml inside the application files. Optionally (based on the Host's copyXML
    attribute) this may be copied to
    $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to
    application's base file name plus a ".xml" extension.</p></li>
    <li><p>In individual files (with a ".xml" extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The context
    path and version will be derived from the base name of the file (the
    file name less the .xml extension). This file will always take
    precedence over any context.xml file packaged in the web
    application's META-INF directory.</p></li>
    <li><p>Inside a Host element in the main conf/server.xml.</p></li>
    </ol>
  </blockquote>
  
  <p>So, please anyone give me some clues, thanks.</p>