title: HTTP Status 500 - Servlet.init() for servlet HelloWeb threw exception?
body: <p>I am new to spring mvc framework and I started trying examples on  <a href="http://www.tutorialspoint.com/spring/spring_mvc_form_handling_example.htm" rel="nofollow">here</a>. But while trying I am getting following error message.</p>
  
  <p>Exception:</p>
  
  <pre><code>javax.servlet.ServletException: Servlet.init() for servlet HelloWeb threw exception
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
  org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
  org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
  org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
  org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Root Cause:</p>
  
  <pre><code>org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 7 in XML document from ServletContext resource [/WEB-INF/HelloWeb-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
  org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
  org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
  org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
  org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
  org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
  org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:467)
  org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:483)
  org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:358)
  org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:325)
  org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
  javax.servlet.GenericServlet.init(GenericServlet.java:158)
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
  org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
  org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
  org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
  org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>I am sharibg content of web.xml and HelloWeb-servlet.xml.</p>
  
  <p>web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="WebApp_ID" version="2.4"
      xmlns="http://java.sun.com/xml/ns/j2ee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
  
  &lt;display-name&gt;Spring MVC Form Handling&lt;/display-name&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;HelloWeb&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;HelloWeb&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;welcome-file-list&gt;
  &lt;welcome-file&gt;student.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
   &lt;/web-app&gt;
  </code></pre>
  
  <p>HelloWeb-servlet.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/context/spring-context-3.0.xsd
    http://www.springframework.org/schema/beans"&gt;
     &lt;context:component-scan base-package="com.tutorialspoint" /&gt;
     &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&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>If you want some other information then you can refer the link mentioned in the content. Please help me to come out of this issue. I am not able to proceed.</p>