title: Error while executing simple SPRING MVC example :SEVERE: Allocate exception for servlet mydispatcher
body: <p><strong>Web.xml</strong></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;MySpringMVC&lt;/display-name&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;mydispatcher&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;mydispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p></p>
  
  <p>but getting following error</p>
  
  <pre><code>SEVERE: StandardWrapper.Throwable
  java.lang.NullPointerException
      at org.springframework.core.SerializableTypeWrapper$TypeProxyInvocationHandler.invoke(SerializableTypeWrapper.java:239)
      at org.springframework.core.$Proxy0.hashCode(Unknown Source)
      at org.springframework.util.ObjectUtils.nullSafeHashCode(ObjectUtils.java:273)
      at org.springframework.core.ResolvableType.hashCode(ResolvableType.java:794)
      at org.springframework.util.ConcurrentReferenceHashMap.getHash(ConcurrentReferenceHashMap.java:214)
      at org.springframework.util.ConcurrentReferenceHashMap.getReference(ConcurrentReferenceHashMap.java:246)
      at org.springframework.util.ConcurrentReferenceHashMap.get(ConcurrentReferenceHashMap.java:226)
      at org.springframework.core.ResolvableType.forType(ResolvableType.java:1169)
      at org.springframework.core.ResolvableType.forType(ResolvableType.java:1148)
      at org.springframework.core.ResolvableType.forTypes(ResolvableType.java:827)
      at org.springframework.core.ResolvableType.getInterfaces(ResolvableType.java:403)
      at org.springframework.core.ResolvableType.as(ResolvableType.java:365)
      at org.springframework.core.convert.support.GenericConversionService.getRequiredTypeInfo(GenericConversionService.java:266)
      at org.springframework.core.convert.support.GenericConversionService.addConverterFactory(GenericConversionService.java:103)
      at org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:79)
      at org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:63)
      at org.springframework.core.convert.support.DefaultConversionService.&lt;init&gt;(DefaultConversionService.java:50)
      at org.springframework.core.env.AbstractPropertyResolver.&lt;init&gt;(AbstractPropertyResolver.java:41)
      at org.springframework.core.env.PropertySourcesPropertyResolver.&lt;init&gt;(PropertySourcesPropertyResolver.java:41)
      at org.springframework.core.env.AbstractEnvironment.&lt;init&gt;(AbstractEnvironment.java:112)
      at org.springframework.core.env.StandardEnvironment.&lt;init&gt;(StandardEnvironment.java:54)
      at org.springframework.web.context.support.StandardServletEnvironment.&lt;init&gt;(StandardServletEnvironment.java:44)
      at org.springframework.web.servlet.HttpServletBean.createEnvironment(HttpServletBean.java:215)
      at org.springframework.web.servlet.HttpServletBean.getEnvironment(HttpServletBean.java:205)
      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
      at javax.servlet.GenericServlet.init(GenericServlet.java:212)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Unknown Source)
  Apr 30, 2014 12:13:15 PM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Allocate exception for servlet mydispatcher
  java.lang.NullPointerException
      at org.springframework.core.SerializableTypeWrapper$TypeProxyInvocationHandler.invoke(SerializableTypeWrapper.java:239)
      at org.springframework.core.$Proxy0.hashCode(Unknown Source)
      at org.springframework.util.ObjectUtils.nullSafeHashCode(ObjectUtils.java:273)
      at org.springframework.core.ResolvableType.hashCode(ResolvableType.java:794)
      at org.springframework.util.ConcurrentReferenceHashMap.getHash(ConcurrentReferenceHashMap.java:214)
      at org.springframework.util.ConcurrentReferenceHashMap.getReference(ConcurrentReferenceHashMap.java:246)
      at org.springframework.util.ConcurrentReferenceHashMap.get(ConcurrentReferenceHashMap.java:226)
      at org.springframework.core.ResolvableType.forType(ResolvableType.java:1169)
      at org.springframework.core.ResolvableType.forType(ResolvableType.java:1148)
      at org.springframework.core.ResolvableType.forTypes(ResolvableType.java:827)
      at org.springframework.core.ResolvableType.getInterfaces(ResolvableType.java:403)
      at org.springframework.core.ResolvableType.as(ResolvableType.java:365)
      at org.springframework.core.convert.support.GenericConversionService.getRequiredTypeInfo(GenericConversionService.java:266)
      at org.springframework.core.convert.support.GenericConversionService.addConverterFactory(GenericConversionService.java:103)
      at org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:79)
      at org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:63)
      at org.springframework.core.convert.support.DefaultConversionService.&lt;init&gt;(DefaultConversionService.java:50)
      at org.springframework.core.env.AbstractPropertyResolver.&lt;init&gt;(AbstractPropertyResolver.java:41)
      at org.springframework.core.env.PropertySourcesPropertyResolver.&lt;init&gt;(PropertySourcesPropertyResolver.java:41)
      at org.springframework.core.env.AbstractEnvironment.&lt;init&gt;(AbstractEnvironment.java:112)
      at org.springframework.core.env.StandardEnvironment.&lt;init&gt;(StandardEnvironment.java:54)
      at org.springframework.web.context.support.StandardServletEnvironment.&lt;init&gt;(StandardServletEnvironment.java:44)
      at org.springframework.web.servlet.HttpServletBean.createEnvironment(HttpServletBean.java:215)
      at org.springframework.web.servlet.HttpServletBean.getEnvironment(HttpServletBean.java:205)
      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
      at javax.servlet.GenericServlet.init(GenericServlet.java:212)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>mydispatcher.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"
  xsi:schemaLocation="http://www.springframework.org/schema/beans 
  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;
  
  &lt;bean name="*/index.html" class="com.mvcController.HelloWorldController" /&gt;
  
  
  &lt;bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="prefix"&gt;
          &lt;value&gt;/WEB-INF/pages/&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="suffix" value=".jsp" /&gt;
  &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>HelloWorldController.java</p>
  
  <pre><code>package com.mvcController;
  
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.springframework.web.servlet.ModelAndView;
  import org.springframework.web.servlet.mvc.AbstractController;
  
  public class HelloWorldController extends AbstractController 
  {
  
  protected ModelAndView handleRequestInternal(HttpServletRequest request,
          HttpServletResponse response) throws Exception {
  
      ModelAndView model = new ModelAndView("HelloWorldPage");
      model.addObject("msg", "hello world");
      return model;
  }
  
  } 
  </code></pre>
  
  <p>/WEB_INF/pages/HelloWorldPage.jsp</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"      "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h1&gt;Spring MVC Hello World Example&lt;/h1&gt;
  &lt;h2&gt;${msg}&lt;/h2&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have posted all the code from my simple helloworld project, but it is not executing properly even all the entries in xmls I think, are correct. And yes I am using SPRING libraries from SPRING 4.0.3, but will a different version of SPRING makes any problem for executing a simple helloworld program?</p>
  
  <p>Every thing mentioned above is in eclipse dynamic web project I am just running index.html on tomcat 6.0 but getting above error.</p>
  
  <p>Jars from WEB-INF/lib</p>
  
  <pre><code>commons-logging-1.1.3.jar
  javax.servlet.jsp.jstl-1.2.1.jar
  servlet-api-2.3.jar
  spring-2.5.jar
  spring-aop-4.0.3.RELEASE.jar
  spring-aspects-4.0.3.RELEASE.jar
  spring-beans-4.0.3.RELEASE.jar
   spring-context-4.0.3.RELEASE.jar
  spring-core-4.0.3.RELEASE.jar
  spring-expression-4.0.3.RELEASE.jar
  spring-framework-bom-4.0.3.RELEASE.jar
  spring-instrument-4.0.3.RELEASE.jar
  spring-instrument-tomcat-4.0.3.RELEASE.jar
  spring-jdbc-4.0.3.RELEASE.jar
  spring-jms-4.0.3.RELEASE.jar
  spring-messaging-4.0.3.RELEASE.jar
  spring-orm-4.0.3.RELEASE.jar
  spring-oxm-4.0.3.RELEASE.jar
  spring-test-4.0.3.RELEASE.jar
  spring-tx-4.0.3.RELEASE.jar
  spring-web-4.0.3.RELEASE.jar
  spring-webmvc-4.0.3.RELEASE.jar
  spring-webmvc-portlet-4.0.3.RELEASE.jar
  spring-websocket-4.0.3.RELEASE.jar
  </code></pre>
  
  <p>I have included all jars available. I want to extend this simple MVC so just added...</p>
  
  <p>Any help would be highly helpful </p>