title: HTTP 500 error: How do I fix my `dispatcher-servlet.xml` file?
body: <p>As I am new to Spring MVC framework and trying to learn, but an exception is thrown. What could be the cause?</p>
  
  <p>It seems like I have an error in my <code>dispatcher-servlet.xml</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans:beans xmlns="http://www.springframework.org/schema/mvc"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:beans="http://www.springframework.org/schema/beans"
  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;annotation-driven /&gt;
    &lt;context:component-scan base-package="kz.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:beans&gt;
  </code></pre>
  
  <p>My controller classes are annotation driven, but it is throwing this error:</p>
  
  <blockquote>
    <p>HTTP Status 500 - <code>Servlet.init()</code> for servlet dispatcher threw exception</p>
    
    <p><strong>type</strong> Exception report</p>
    
    <p><strong>message</strong> <code>Servlet.init()</code> for servlet dispatcher threw exception</p>
    
    <p><strong>description</strong> The server encountered an internal error that prevented it from fulfilling this request.</p>
    
    <p><strong>exception</strong></p>
    
    <p><code>javax.servlet.ServletException</code>: <code>Servlet.init()</code> for servlet dispatcher threw exception
       <code>org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException</code>: Line 23 in XML document from <code>ServletContext</code> resource [<code>/WEB-INF/dispatcher-servlet.xml</code>] is invalid;</p>
  </blockquote>