title: Spring MVC Simple Project - 404
body: <p>I new about Spring, i'm trying to create a simple project but i can't figure it out!</p>
  
  <p>I have java JDK 7 up to date.</p>
  
  <p>Apache Tomcat 7 up to date.</p>
  
  <p>Spring 3 framework / Eclipse JUNO 4 integrated.</p>
  
  <p><a href="http://emanuelepirro.altervista.org/Java_EE_-_SpringMVCsrccontrollerHomeController.png" rel="nofollow">HERE</a>
  it is my project structure (sorry for the external link bur i have not 10 reputation points)</p>
  
  <p>My web.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
  
      &lt;!-- Processes application requests --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/spring/appServlet/servlet-context.xml&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>My servlet-context.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:mvc="http://www.springframework.org/schema/mvc"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="
          http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
          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;!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure --&gt;
  
      &lt;!-- Scans within the base package of the application for @Components to configure as beans --&gt;
      &lt;!-- @Controller, @Service, @Configuration, etc. --&gt;
      &lt;context:component-scan base-package="controller" /&gt;
  
      &lt;!-- Enables the Spring MVC @Controller programming model --&gt;
      &lt;mvc:annotation-driven /&gt;
  
      &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/views/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>My HomeController.java file:</p>
  
  <pre><code>package controller;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  
  /**
   * Handles requests for the application home page.
   */
  @Controller
  public class HomeController {
  
      @RequestMapping(value = "/home")
      public String home() {
          System.out.println("HomeController: Passing through...");
          return "home";
      }
  }
  </code></pre>
  
  <p>My problem is that when i call the servlet from the browser (for instance in that way):</p>
  
  <pre><code>http://localhost:8080/SpringMVC/home
  </code></pre>
  
  <p><strong>i have a HTTP 400 error - description The requested resource is not available.</strong></p>
  
  <p>I suspect is a libraries problem but i put all the Spring libraries (and much more) in WEB-INF/lib. In the Eclipse project obviously i add everything in the classpath.</p>
  
  <p>I paste the Tomcat's localhost log:</p>
  
  <p>*</p>
  
  <pre><code>apr 13, 2013 3:44:43 PM org.apache.catalina.core.ApplicationContext log
  INFO: SessionListener: contextDestroyed()
  apr 13, 2013 3:44:43 PM org.apache.catalina.core.ApplicationContext log
  INFO: ContextListener: contextDestroyed()
  apr 13, 2013 3:44:47 PM org.apache.catalina.core.ApplicationContext log
  INFO: ContextListener: contextInitialized()
  apr 13, 2013 3:44:47 PM org.apache.catalina.core.ApplicationContext log
  INFO: SessionListener: contextInitialized()
  apr 13, 2013 3:44:47 PM org.apache.catalina.core.ApplicationContext log
  INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@189b904')
  </code></pre>
  
  <p>*</p>
  
  <p>and the Tomcat strERR log:</p>
  
  <p>*</p>
  
  <pre><code>2013-04-13 15:44:46 Commons Daemon procrun stderr initialized
  apr 13, 2013 3:44:47 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:\Program Files\Apache Software Foundation\Tomcat 7.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Windows Live\Shared;C:\Program Files\Autodesk\Backburner\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;;.
  apr 13, 2013 3:44:47 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["http-bio-8080"]
  apr 13, 2013 3:44:47 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 397 ms
  apr 13, 2013 3:44:47 PM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  apr 13, 2013 3:44:47 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/7.0.39
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\.metadata
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\docs
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\examples
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\host-manager
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\manager
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\Servers
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\SpringMVC
  apr 13, 2013 3:44:47 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  apr 13, 2013 3:44:47 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  apr 13, 2013 3:44:47 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 540 ms
  </code></pre>
  
  <p>*</p>
  
  <p>I'm EXHAUSTED, i'm since yesterday to fight with this project, please help me! :)</p>