title: How to configure customEditors property of CustomEditorConfigurer in Spring 4.0.6
body: <p>I am migrating from Spring 3.2.4 to Spring 4.0.6 and I couldnt configure CustomEditorConfigurer in the newer version</p>
  
  <p>Below was the configuration for Spring 3.2.4 in <code>applicationContext.xml</code></p>
  
  <pre><code>&lt;bean class="org.springframework.beans.factory.config.CustomEditorConfigurer"&gt;
      &lt;property name="customEditors"&gt;
          &lt;map&gt;
              &lt;entry key="java.util.Date"&gt;
                  &lt;bean class="org.springframework.beans.propertyeditors.CustomDateEditor"&gt;
                      &lt;constructor-arg index="0"&gt;
                          &lt;bean class="java.text.SimpleDateFormat"&gt;
                              &lt;constructor-arg value="MM/dd/yyyy" /&gt;
                          &lt;/bean&gt;
                      &lt;/constructor-arg&gt;
                      &lt;constructor-arg index="1" value="true" /&gt;
                  &lt;/bean&gt;
              &lt;/entry&gt;
          &lt;/map&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>And I tried to use the same configuration in Spring 4.0.6 then am getting below error</p>
  
  <pre><code>org.springframework.web.servlet.DispatcherServlet | Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.CustomEditorConfigurer#0' defined in ServletContext resource [/WEB-INF/config/core/admin-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'customEditors'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.beans.propertyeditors.CustomDateEditor] to required type [java.lang.Class] for property 'customEditors[java.util.Date]': PropertyEditor [org.springframework.beans.propertyeditors.ClassEditor] returned inappropriate value of type [org.springframework.beans.propertyeditors.CustomDateEditor]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:167)
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
      at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
      at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
      at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
      at javax.servlet.GenericServlet.init(GenericServlet.java:158)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1279)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1192)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'customEditors'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.beans.propertyeditors.CustomDateEditor] to required type [java.lang.Class] for property 'customEditors[java.util.Date]': PropertyEditor [org.springframework.beans.propertyeditors.ClassEditor] returned inappropriate value of type [org.springframework.beans.propertyeditors.CustomDateEditor]
      at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:479)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1502)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1461)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
      ... 28 more
  Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.beans.propertyeditors.CustomDateEditor] to required type [java.lang.Class] for property 'customEditors[java.util.Date]': PropertyEditor [org.springframework.beans.propertyeditors.ClassEditor] returned inappropriate value of type [org.springframework.beans.propertyeditors.CustomDateEditor]
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:263)
      at org.springframework.beans.TypeConverterDelegate.convertToTypedMap(TypeConverterDelegate.java:623)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:208)
      at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459)
      ... 34 more
  </code></pre>
  
  <p>I've compared the <code>CustomEditorConfigurer</code> class in Spring 3.2.4 and Spring 4.0.6 and noticed there is a change in <code>customEditors</code> type. In Spring 4.0.6 <code>customEditors</code> type is <code>Map&lt;Class&lt;?&gt;, Class&lt;? extends PropertyEditor&gt;&gt; customEditors;</code> compared to Spring 3.2.4 <code>Map&lt;String, ?&gt; customEditors;</code></p>
  
  <p>Can someone help me configuring it for Spring 4.0.6 </p>