title: No mapping found for HTTP request with URI [] in DispatcherServlet with name
body: <p>i am doing sample on spring webservices,when i run this sample i am getting below error</p>
  
  <p>No mapping found for HTTP request with URI [/SpringRestfulWebServicesExample/] in DispatcherServlet with name 'springrest'</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;!DOCTYPE web-app PUBLIC
   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
   "http://java.sun.com/dtd/web-app_2_3.dtd" &gt;
   &lt;web-app&gt;
    &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
    &lt;servlet&gt;  
    &lt;servlet-name&gt;springrest&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;springrest&lt;/servlet-name&gt;  
  &lt;url-pattern&gt;/*&lt;/url-pattern&gt;  
  &lt;/servlet-mapping&gt;  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>springrest-servlet.xml</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"  
  xmlns:context="http://www.springframework.org/schema/context"  
  xmlns:mvc="http://www.springframework.org/schema/mvc"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  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   http://www.springframework.org/schema/mvc   http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;  
  &lt;mvc:annotation-driven/&gt;  
  &lt;context:component-scan base-package="org.arpit.java2blog.controller" /&gt;  
  &lt;/beans&gt;  
  </code></pre>
  
  <p>SpringrestfulwebserviceExample.xml</p>
  
  <pre><code>&lt;dependencies&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;3.8.1&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
   &lt;/dependency&gt;
  
   &lt;dependency&gt;  
   &lt;groupId&gt;javax.servlet&lt;/groupId&gt;  
   &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;  
   &lt;version&gt;3.1.0&lt;/version&gt;  
   &lt;/dependency&gt;  
  
    &lt;dependency&gt;  
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;  
     &lt;artifactId&gt;spring-core&lt;/artifactId&gt;  
     &lt;version&gt;${spring.version}&lt;/version&gt;  
    &lt;/dependency&gt;  
    &lt;dependency&gt;  
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;  
    &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;  
    &lt;version&gt;${spring.version}&lt;/version&gt;  
     &lt;/dependency&gt;  
     &lt;/dependencies&gt;
     &lt;build&gt;
  
     &lt;finalName&gt;SpringRestfulWebServicesExample&lt;/finalName&gt;
  
     &lt;plugins&gt;  
    &lt;plugin&gt;  
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;  
    &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;  
    &lt;version&gt;3.1&lt;/version&gt;  
    &lt;configuration&gt;  
    &lt;source&gt;${jdk.version}&lt;/source&gt;  
    &lt;target&gt;${jdk.version}&lt;/target&gt;  
    &lt;/configuration&gt;  
    &lt;/plugin&gt;  
    &lt;/plugins&gt;  
    &lt;/build&gt;
  
    &lt;properties&gt;  
    &lt;spring.version&gt;4.2.1.RELEASE&lt;/spring.version&gt;  
    &lt;jdk.version&gt;1.8&lt;/jdk.version&gt;  
    &lt;/properties&gt;
  
    &lt;/project&gt;
  </code></pre>
  
  <p>Springrestcontroller.java</p>
  
  <pre><code>    @RestController  
      @RequestMapping("/hello")  
      public class SpringRestController {  
      @RequestMapping(value = "/{name}", method = RequestMethod.GET)  
      public String hello(@PathVariable String name) {  
      String result="Hello "+name;    
      return result;  
     }  
     }
  </code></pre>
  
  <p>in springrest-servlet.xml i am getting below errors</p>
  
  <pre><code>1. cvc-elt.1: Cannot find the declaration of element 'beans'
  2. Multiple annotations found at this line:
  - schema_reference.4: Failed to read schema document   'http://www.springframework.org/schema/context/spring-context-3.0.xsd', because    1) could 
   not find the document; 2) the document could not be read; 3) the root   element of the document is not &lt;xsd:schema&gt;.
  - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'.
  </code></pre>
  
  <p>error</p>
  
  <pre><code>Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Server version:        Apache Tomcat/8.0.30
   Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
   INFO: Server built:          Dec 1 2015 22:30:46 UTC
   Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
   INFO: Server number:         8.0.30.0
   Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
   INFO: OS Name:               Windows 7
    Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: OS Version:            6.1
    Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
     INFO: Architecture:          amd64
     Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
     INFO: Java Home:             C:\Program Files\Java\jdk1.8.0_65\jre
     Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
     INFO: JVM Version:           1.8.0_65-b17
     Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Vendor:            Oracle Corporation
     Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_BASE:         C:\Program Files\Apache Software Foundation\Tomcat 8.0
    Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat 8.0
    Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 8.0
     Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
      INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache  Software Foundation\Tomcat 8.0
    Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
       INFO: Command line argument: -Dwtp.deploy=C:\Program Files\Apache Software Foundation\Tomcat 8.0\wtpwebapps
     Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
     INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache    Software Foundation\Tomcat 8.0\endorsed
    Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.VersionLoggerListener log
   INFO: Command line argument: -Dfile.encoding=Cp1252
    Dec 27, 2015 11:11:54 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    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\jdk1.8.0_65\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Window   s;D:/supriya/bin/server;D:/supriya/bin;D:/supriya/lib/amd64;C:\ProgramData\Oracl  e\Java\javapath;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program    Files\Intel\iCLS  Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Syste        m32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL     SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;C:\Program   Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program   Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files   (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\nodejs\;C:\Program Files\TortoiseSVN\bin;C:\android-sdk-  win\tools;C:\android-sdk-win\platform-tools;C:\Program Files\Git\bin;C:\Users\star\AppData\Roaming\Appcelerator\Titanium   Studio;C:\Program Files\nodejs;C:\Program Files   (x86)\Java\jdk1.6.0_20\bin;C:\Program Files\Microsoft\Web Platform   Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web   Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\SourceGear\Common\DiffMerge\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Users\star\AppData\Roaming\npm;C:\Users\star\Desktop\eclipse-jee-mars-1-win32-x86_64\eclipse;;.
    Dec 27, 2015 11:11:54 PM org.apache.coyote.AbstractProtocol init
   INFO: Initializing ProtocolHandler ["http-nio-8080"]
    Dec 27, 2015 11:11:54 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
   INFO: Using a shared selector for servlet write/read
   Dec 27, 2015 11:11:54 PM org.apache.coyote.AbstractProtocol init
   INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
   Dec 27, 2015 11:11:54 PM org.apache.tomcat.util.net.NioSelectorPool  getSharedSelector
  INFO: Using a shared selector for servlet write/read
   Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 1108 ms
   Dec 27, 2015 11:11:54 PM org.apache.catalina.core.StandardService startInternal
   INFO: Starting service Catalina
   Dec 27, 2015 11:11:54 PM org.apache.catalina.core.StandardEngine startInternal
   INFO: Starting Servlet Engine: Apache Tomcat/8.0.30
   Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.HostConfig deployDescriptor
   INFO: Deploying configuration descriptor C:\Program Files\Apache Software  Foundation\Tomcat  8.0\conf\Catalina\localhost\SpringRestfulWebServicesExample.xml
   Dec 27, 2015 11:11:54 PM org.apache.catalina.startup.SetContextPropertiesRule begin
   WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:SpringRestfulWebServicesExample' did not find a matching property.
   Dec 27, 2015 11:11:56 PM org.apache.jasper.servlet.TldScanner scanJars
   INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable   debug logging for this logger for a complete list of JARs that were scanned but   no TLDs were found in them. Skipping unneeded JARs during scanning can improve   startup time and JSP compilation time.
   Dec 27, 2015 11:11:56 PM org.apache.catalina.core.ApplicationContext log
   INFO: No Spring WebApplicationInitializer types detected on classpath
   Dec 27, 2015 11:11:56 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
   INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [219] milliseconds.
  Dec 27, 2015 11:11:56 PM org.apache.catalina.core.ApplicationContext log
  INFO: Initializing Spring FrameworkServlet 'springrest'
   Dec 27, 2015 11:11:56 PM org.springframework.web.servlet.DispatcherServlet initServletBean
   INFO: FrameworkServlet 'springrest': initialization started
  Dec 27, 2015 11:11:56 PM     org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
  INFO: Refreshing WebApplicationContext for namespace 'springrest-servlet': startup date [Sun Dec 27 23:11:56 IST 2015]; root of context hierarchy
  Dec 27, 2015 11:11:56 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/springrest-servlet.xml]
    Dec 27, 2015 11:11:58 PM   org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache
   INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace 'springrest-servlet': startup date [Sun Dec 27 23:11:56 IST 2015]; root of context hierarchy
   Dec 27, 2015 11:11:58 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapt er initControllerAdviceCache
   INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace   'springrest-servlet': startup date [Sun Dec 27 23:11:56 IST 2015]; root of   context hierarchy
   Dec 27, 2015 11:11:58 PM org.springframework.web.servlet.DispatcherServlet initServletBean
   INFO: FrameworkServlet 'springrest': initialization completed in 1569 ms
    Dec 27, 2015 11:11:58 PM org.apache.catalina.startup.HostConfig deployDescriptor
   INFO: Deployment of configuration descriptor C:\Program Files\Apache   Software Foundation\Tomcat   8.0\conf\Catalina\localhost\SpringRestfulWebServicesExample.xml has finished in   3,832 ms
   Dec 27, 2015 11:11:58 PM org.apache.catalina.startup.HostConfig deployDirectory
   INFO: Deploying web application directory C:\Program Files\Apache Software  Foundation\Tomcat 8.0\webapps\docs
    Dec 27, 2015 11:11:58 PM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deployment of web application directory C:\Program Files\Apache   Software Foundation\Tomcat 8.0\webapps\docs has finished in 39 ms
     Dec 27, 2015 11:11:58 PM org.apache.catalina.startup.HostConfig deployDirectory
     INFO: Deploying web application directory C:\Program Files\Apache   Software Foundation\Tomcat 8.0\webapps\manager
     Dec 27, 2015 11:11:58 PM org.apache.catalina.startup.HostConfig deployDirectory
     INFO: Deployment of web application directory C:\Program Files\Apache   Software Foundation\Tomcat 8.0\webapps\manager has finished in 55 ms
    Dec 27, 2015 11:11:58 PM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\ROOT
    Dec 27, 2015 11:11:58 PM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\ROOT has finished in 31 ms
    Dec 27, 2015 11:11:58 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["http-nio-8080"]
    Dec 27, 2015 11:11:58 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["ajp-nio-8009"]
     Dec 27, 2015 11:11:58 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4031 ms
    Dec 27, 2015 11:12:46 PM org.springframework.web.servlet.PageNotFound  noHandlerFound
    WARNING: No mapping found for HTTP request with URI [/SpringRestfulWebServicesExample/hello/name] in DispatcherServlet with name 'springrest'
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/UM0jf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UM0jf.png" alt="enter image description here"></a></p>
  
  <p>How to solve these issues.Any help is appreciated.</p>