title: Is Tomcat 8 reading the web.xml and context.xml files in my Java Rest API (war)?
body: <p>I created a Java Rest API (Dynamic Web) project in Eclipse (including Javax and Jersey libraries) and deployed it to my Tomcat 8 server.</p>
  <p>It returns a basic JSON response when I call it via HTTP (e.g. <code>http://www.mydomain.co.uk:8080/MyJavaProject/context_string/path_params</code>), but when I enable SSL/TLS on the server, with a genuine certificate, it gives a <code>404 Not Found</code> in Postman.</p>
  <p><code>error.log</code> shows a <code>file does not exist</code> error on <code>/path/MyJavaProject/context_string/path_params</code>, but the file doesn't exist as it's a reference param in my REST API, so I don't think Tomcat knows to use the WAR file.</p>
  <p>I can get to the directory structure navigator if I call <code>https://www.mydomain.co.uk/MyJavaProject</code>.</p>
  <p>My logs are all OK and show no errors now. I have put the security values in my <code>web.xml</code> in my app's <code>WEB-INF</code>. Permissions on the <code>WAR</code> and its exploded folder are all <code>777</code>.</p>
  <p>I have read that something called <code>context.xml</code> is used in this area, but may or may not be used if <code>autoDeploy-true</code> is set (mine is).</p>
  <p>My question is: how can I find out if Tomcat is actually reading the <code>context.xml</code> and <code>web.xml</code> in my app?  This is my last idea to try and resolve my 404 error.</p>
  <p>Here is my app's <code>web.xml</code> file:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&quot; id=&quot;WebApp_ID&quot; version=&quot;3.0&quot;&gt;
    &lt;display-name&gt;MyProject&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    
    &lt;servlet&gt;
      &lt;servlet-name&gt;ServletAdaptor&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
  com.sun.jersey.server.impl.container.servlet.ServletAdaptor&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;/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;security-constraint&gt;
  &lt;web-resource-collection&gt;
  &lt;web-resource-name&gt;MyProject&lt;/web-resource-name&gt;
  &lt;url-pattern&gt;/context_string/*&lt;/url-pattern&gt;
  &lt;/web-resource-collection&gt;
  &lt;user-data-constraint&gt;
  &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt;
  &lt;/user-data-constraint&gt;
  &lt;/security-constraint&gt;
  &lt;/web-app&gt;
  </code></pre>
  <p>Here is my app's <code>context.xml</code> file:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Context docBase=&quot;&quot; path=&quot;&quot; reloadable=&quot;true&quot;&gt;
  &lt;/Context&gt;
  </code></pre>