title: cannot run servlet on apache tomcat .it says, The requested resource is not available
body: <p>Dear stackoverflow members,</p>
  
  <p>what i already did so far:</p>
  
  <ol>
  <li><p>i create apache tomcat server from my eclipse</p></li>
  <li><p>i also success running simple "hello world" in .html file</p></li>
  </ol>
  
  <p>the problem is when I run a servlet it showing error</p>
  
  <blockquote>
    <p>HTTP Status 404 - /SimpleServletProject/SimpleServlet</p>
    
    <p>type Status report</p>
    
    <p>message /SimpleServletProject/SimpleServlet</p>
    
    <p>description The requested resource is not available.</p>
    
    <hr>
    
    <p>Apache Tomcat/7.0.42</p>
  </blockquote>
  
  <p>on below is my servlet</p>
  
  <pre><code>package com.bukuwow.azura;
  
  import java.io.IOException;
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  /**
   * Servlet implementation class SimpleServlet
   */
  @WebServlet(description = "a simple servlet", urlPatterns = { "/SimpleServlet" })
  public class SimpleServlet extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
      /**
       * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          System.out.println("Hello from servlet");
      }
  
  }
  </code></pre>
  
  <p>Here is my project structure</p>
  
  <pre><code>SimpleServletProject
  -------.settings
  ------------.jsdtscope
  ------------org.eclipse.jdt.core.prefs
  ------------org.eclipse.wst.common.component
  ------------org.eclipse.wst.common.project.facet.core.xml
  ------------org.eclipse.wst.jsdt.ui.superType.container
  ------------org.eclipse.wst.jsdt.ui.superType.name
  -------build
  ------------classes
  -------src
  ------------com
  -----------------bukuwow
  ----------------------azura
  ---------------------------SimpleServlet.java
  -------WebContent
  ------------META-INF
  -----------------MANIFEST.MF
  ------------WEB-INF
  -----------------lib
  -----------------web.xml
  ------------index.html
  -------.classpath
  -------.project
  </code></pre>
  
  <p>the log file look normal</p>
  
  <pre><code>Nov 05, 2014 10:51:17 AM org.apache.catalina.core.AprLifecycleListener init
  INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\Program Files (x86)\Seagate Software\NOTES\;C:\Program Files (x86)\Seagate Software\NOTES\DATA\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files (x86)\Common Files\Autodesk Shared\;C:\Program Files\MATLAB\R2013a\runtime\win64;C:\Program Files\MATLAB\R2013a\bin;C:\Program Files\Calibre2\;C:\xampp\mysql\bin;C:\Android\apache-ant-1.9.2-bin\apache-ant-1.9.2\bin;C:\Program Files (x86)\Rational\common;C:\Program Files (x86)\Git\cmd;C:\Program Files\Java\jdk1.7.0_45\bin;C:\Program Files (x86)\MacType;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Users\azura\apache-maven-3.2.2\bin;C:\Ruby200\bin;.
  Nov 05, 2014 10:51:17 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
  WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SimpleServletProject' did not find a matching property.
  Nov 05, 2014 10:51:18 AM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["http-bio-8080"]
  Nov 05, 2014 10:51:18 AM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
  Nov 05, 2014 10:51:18 AM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 1162 ms
  Nov 05, 2014 10:51:18 AM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  Nov 05, 2014 10:51:18 AM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
  Nov 05, 2014 10:51:19 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom
  INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [384] milliseconds.
  Nov 05, 2014 10:51:19 AM org.apache.catalina.startup.HostConfig deployDescriptor
  INFO: Deploying configuration descriptor C:\xampp\tomcat\conf\Catalina\localhost\website.xml
  Nov 05, 2014 10:51:19 AM org.apache.catalina.startup.HostConfig deployWAR
  INFO: Deploying web application archive C:\xampp\tomcat\webapps\my-webapp.war
  Nov 05, 2014 10:51:19 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\xampp\tomcat\webapps\docs
  Nov 05, 2014 10:51:19 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\xampp\tomcat\webapps\examples
  Nov 05, 2014 10:51:19 AM org.apache.catalina.core.ApplicationContext log
  INFO: ContextListener: contextInitialized()
  Nov 05, 2014 10:51:19 AM org.apache.catalina.core.ApplicationContext log
  INFO: SessionListener: contextInitialized()
  Nov 05, 2014 10:51:19 AM org.apache.catalina.core.ApplicationContext log
  INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@622f1be6')
  Nov 05, 2014 10:51:19 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\xampp\tomcat\webapps\host-manager
  Nov 05, 2014 10:51:20 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\xampp\tomcat\webapps\manager
  Nov 05, 2014 10:51:20 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\xampp\tomcat\webapps\ROOT
  Nov 05, 2014 10:51:20 AM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  Nov 05, 2014 10:51:20 AM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  Nov 05, 2014 10:51:20 AM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 2092 ms
  </code></pre>
  
  <p>here my 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;SimpleServletProject&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;/web-app&gt;
  </code></pre>