title: Application deployed on Tomcat, error 404
body: <p>I had a java web app which was working fine on the <code>AWS server</code>. However, after some time and perhaps some slight changes, which I can't remember, I am getting <code>404 error</code>.</p>
  
  <p>I have tried to reboot the server, restart the tomcat re-deploy the app.</p>
  
  <p>Nothing works, I have also set public <code>RWX</code> permission. </p>
  
  <p>The <code>Tomcat</code> version is 7, Java as well. It all came in an <code>AMI</code> package by <code>AWS</code>.</p>
  
  <p>I am getting the same result when I try to go: <code>/manager/index.jsp</code></p>
  
  <p>Any idea? Is there more information I can provide?</p>
  
  <pre><code>web.xml:
  
  
   &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"
      version="3.0"&gt;
      &lt;display-name&gt;Visma_UploadInterface&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;LoginServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;servlets.LoginServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;LoginServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/main/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;MainPageServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;servlets.MainPageServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;MainPageServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/mainPage/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;MappingServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;servlets.MappingServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;MappingServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/mapping/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;ListImportServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;servlets.ListImportServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;ListImportServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/listImport/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;RejectedRecordsServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;servlets.RejectedRecordsServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;RejectedRecordsServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/rejectedRecords/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;UploadServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;servlets.UploadServlet&lt;/servlet-class&gt;
  
      &lt;/servlet&gt;
  
  
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Maybe the solution would be to reinstall the Tomcat, but is there a way just to get a fresh installation of it from AWS? Or some rollback?</p>
  
  <p>Some logs from <code>Catalina.out</code> they show errors:</p>
  
  <pre><code>SEVERE: Failed to initialize end point associated with ProtocolHandler ["ajp-bio-8009"]
  java.net.BindException: Address already in use &lt;null&gt;:8009
      at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:413)
      at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:649)
      at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
      at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
      at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
      at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:821)
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
  Caused by: java.net.BindException: Address already in use
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
      at java.net.ServerSocket.bind(Unknown Source)
      at java.net.ServerSocket.&lt;init&gt;(Unknown Source)
      at java.net.ServerSocket.&lt;init&gt;(Unknown Source)
      at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49)
      at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:400)
      ... 16 more
  
  Aug 12, 2015 12:44:43 PM org.apache.catalina.core.StandardService initInternal
  SEVERE: Failed to initialize connector [Connector[AJP/1.3-8009]]
  org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8009]]
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
      at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
      at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:821)
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
  Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
      at org.apache.catalina.connector.Connector.initInternal(Connector.java:980)
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
      ... 12 more
  Caused by: java.net.BindException: Address already in use &lt;null&gt;:8009
      at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:413)
      at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:649)
      at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
      at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
      ... 13 more
  Caused by: java.net.BindException: Address already in use
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
      at java.net.ServerSocket.bind(Unknown Source)
      at java.net.ServerSocket.&lt;init&gt;(Unknown Source)
      at java.net.ServerSocket.&lt;init&gt;(Unknown Source)
      at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49)
      at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:400)
      ... 16 more
  </code></pre>
  
  <p>I have changed a port from <code>8009</code> to <code>8089</code> in the <code>server.xml</code> configuration file.</p>
  
  <p>I was able to get rid of the above error in <code>catalina.out</code> however, the issue with the <code>404</code> still persists.</p>
  
  <p>Now I was able to get to the <code>Tomcat manager</code> and also log in. However, my app still shows 404.</p>