title: Why am I getting a 404 requested resource not available error from Tomcat 7
body: <p>I have recreated this project in Eclipse as many ways as I can think of and continue to get this same error- </p>
  
  <pre><code>HTTP Status 404 - /SpringTest/hello 
  
      type Status report
  
      message /SpringTest/hello
  
      description The requested resource (/SpringTest/hello) is not available.
  </code></pre>
  
  <p>Please help me find the issue in my code below.</p>
  
  <p>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"
      xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      id="WebApp_ID" version="2.5"&gt;
      &lt;display-name&gt;Spring3MVC&lt;/display-name&gt;
      &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
          &lt;servlet-class&gt;
              org.springframework.web.servlet.DispatcherServlet
          &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;spring&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>spring-servlet.xml - </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:p="http://www.springframework.org/schema/p"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
      &lt;context:component-scan
          base-package="net.viralpatel.spring3.controller" /&gt;
  
      &lt;bean id="viewResolver"
          class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;
          &lt;property name="viewClass"
              value="org.springframework.web.servlet.view.JstlView" /&gt;
          &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Controller - </p>
  
  <pre><code>package net.viralpatel.spring3.controller;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.servlet.ModelAndView;
  
  @Controller
  public class HelloWorldController {
  
      @RequestMapping("/hello")
      public ModelAndView helloWorld() {
  
          String message = "Hello World, Spring 3.0!";
          return new ModelAndView("hello", "message", message);
      }
  }
  </code></pre>
  
  <p>index.jsp -</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Spring 3.0 MVC Series: Index - ViralPatel.net&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;a href="hello"&gt;Say Hello&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>hello.jsp</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Spring 3.0 MVC Series: Hello World - ViralPatel.net&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      ${message}
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>.classpath - </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;classpath&gt;
  &lt;classpathentry kind="src" path="src"/&gt;
  &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk"&gt;
      &lt;attributes&gt;
          &lt;attribute name="owner.project.facets" value="java"/&gt;
      &lt;/attributes&gt;
  &lt;/classpathentry&gt;
  &lt;classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Tomcat"&gt;
      &lt;attributes&gt;
          &lt;attribute name="owner.project.facets" value="jst.web"/&gt;
      &lt;/attributes&gt;
  &lt;/classpathentry&gt;
  &lt;classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/&gt;
  &lt;classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/&gt;
  &lt;classpathentry kind="output" path="build/classes"/&gt;
  &lt;/classpath&gt;
  </code></pre>
  
  <p>.project - </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;projectDescription&gt;
  &lt;name&gt;SpringTest&lt;/name&gt;
  &lt;comment&gt;&lt;/comment&gt;
  &lt;projects&gt;
  &lt;/projects&gt;
  &lt;buildSpec&gt;
      &lt;buildCommand&gt;
          &lt;name&gt;org.eclipse.wst.jsdt.core.javascriptValidator&lt;/name&gt;
          &lt;arguments&gt;
          &lt;/arguments&gt;
      &lt;/buildCommand&gt;
      &lt;buildCommand&gt;
          &lt;name&gt;org.eclipse.jdt.core.javabuilder&lt;/name&gt;
          &lt;arguments&gt;
          &lt;/arguments&gt;
      &lt;/buildCommand&gt;
      &lt;buildCommand&gt;
          &lt;name&gt;org.eclipse.wst.common.project.facet.core.builder&lt;/name&gt;
          &lt;arguments&gt;
          &lt;/arguments&gt;
      &lt;/buildCommand&gt;
      &lt;buildCommand&gt;
          &lt;name&gt;org.eclipse.wst.validation.validationbuilder&lt;/name&gt;
          &lt;arguments&gt;
          &lt;/arguments&gt;
      &lt;/buildCommand&gt;
  &lt;/buildSpec&gt;
  &lt;natures&gt;
      &lt;nature&gt;org.eclipse.jem.workbench.JavaEMFNature&lt;/nature&gt;
      &lt;nature&gt;org.eclipse.wst.common.modulecore.ModuleCoreNature&lt;/nature&gt;
      &lt;nature&gt;org.eclipse.wst.common.project.facet.core.nature&lt;/nature&gt;
      &lt;nature&gt;org.eclipse.jdt.core.javanature&lt;/nature&gt;
      &lt;nature&gt;org.eclipse.wst.jsdt.core.jsNature&lt;/nature&gt;
  &lt;/natures&gt;
  &lt;/projectDescription&gt;
  </code></pre>
  
  <p>My Project - </p>
  
  <p><img src="https://i.stack.imgur.com/spi70.gif" alt="My Project Explorer"></p>
  
  <p>Eclipse console output - </p>
  
  <pre><code>May 21, 2011 10:28:11 PM 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:\glassfish3\jdk\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/glassfish3/jdk/bin/../jre/bin/client;C:/glassfish3/jdk/bin/../jre/bin;C:/glassfish3/jdk/bin/../jre/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\QuickTime\QTSystem\;C:\glassfish3\jdk\bin;C:\eclipse-jee-helios-SR2-win32\eclipse;
  May 21, 2011 10:28:11 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
  WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SpringTest' did not find a matching property.
  May 21, 2011 10:28:11 PM org.apache.coyote.AbstractProtocolHandler init
  INFO: Initializing ProtocolHandler ["http-bio-8080"]
  May 21, 2011 10:28:11 PM org.apache.coyote.AbstractProtocolHandler init
  INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
  May 21, 2011 10:28:11 PM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 425 ms
  May 21, 2011 10:28:11 PM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  May 21, 2011 10:28:11 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/7.0.14
  May 21, 2011 10:28:11 PM org.apache.catalina.core.ApplicationContext log
  INFO: Initializing Spring FrameworkServlet 'spring'
  May 21, 2011 10:28:11 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  INFO: FrameworkServlet 'spring': initialization started
  May 21, 2011 10:28:11 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
  INFO: Refreshing WebApplicationContext for namespace 'spring-servlet': startup date [Sat May 21 22:28:11 CDT 2011]; root of context hierarchy
  May 21, 2011 10:28:11 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-servlet.xml]
  May 21, 2011 10:28:12 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
  INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1e1ec86: defining beans [helloWorldController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,viewResolver]; root of factory hierarchy
  May 21, 2011 10:28:12 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/hello] onto handler 'helloWorldController'
  May 21, 2011 10:28:12 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/hello.*] onto handler 'helloWorldController'
  May 21, 2011 10:28:12 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/hello/] onto handler 'helloWorldController'
  May 21, 2011 10:28:12 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  INFO: FrameworkServlet 'spring': initialization completed in 545 ms
  May 21, 2011 10:28:12 PM org.apache.coyote.AbstractProtocolHandler start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  May 21, 2011 10:28:12 PM org.apache.coyote.AbstractProtocolHandler start
  INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  May 21, 2011 10:28:12 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 1139 ms
  </code></pre>