title: Error in converting from String to class-Springs MVC
body: <p>I am finding an error in my following my program.My <code>spring-servlet.xml file</code> where I figured the error is </p>
  
  <p>
  
  <pre><code>class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
          &lt;property name="annotatedClasses"&gt;
                  &lt;value&gt;com.contactmanager.dao.Contact&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;${hibernate.dialect}&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;${hibernate.show_sql}&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>The error which i encountered is</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class[]' for property 'annotatedClasses'; nested exception is java.lang.IllegalArgumentException: Cannot find class [com.contactmanager.dao.Contact]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
      at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
      at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
      at javax.servlet.GenericServlet.init(GenericServlet.java:212)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class[]' for property 'annotatedClasses'; nested exception is java.lang.IllegalArgumentException: Cannot find class [com.contactmanager.dao.Contact]
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:457)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1354)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1313)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
      ... 31 more
  Caused by: java.lang.IllegalArgumentException: Cannot find class [com.contactmanager.dao.Contact]
      at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:294)
      at org.springframework.beans.propertyeditors.ClassArrayEditor.setAsText(ClassArrayEditor.java:67)
      at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:474)
      at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:446)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:215)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:154)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:452)
      ... 35 more
  Caused by: java.lang.ClassNotFoundException: com.contactmanager.dao.Contact
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
      at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:291)
      ... 41 more
  
  Aug 21, 2013 12:07:53 PM org.apache.catalina.core.StandardContext loadOnStartup
  SEVERE: Servlet /MyContactManager threw load() exception
  java.lang.ClassNotFoundException: com.contactmanager.dao.Contact
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
      at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:291)
      at org.springframework.beans.propertyeditors.ClassArrayEditor.setAsText(ClassArrayEditor.java:67)
      at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:474)
      at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:446)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:215)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:154)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:452)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1354)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1313)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
      at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
      at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
      at javax.servlet.GenericServlet.init(GenericServlet.java:212)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  </code></pre>
  
  <p>My class <code>com.contactmanager.dao.Contact</code> is totally  correct.Unable to figure out the problem.</p>