org.springframework.beans.TypeMismatchException: Failed to convert value 'java.lang.String' to 'java.lang.Class' spring
<p>I dont know why  spring is giving me this error when I launch my application. I have defined the java class in the package and calling it in the xml file through bean injection.</p>

<p>This is the bean injection</p>

<pre><code> &lt;bean id="sessionFactory"
          class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
        &lt;property name="dataSource" ref="dataSource" /&gt;
        &lt;property name="annotatedClasses"&gt;
            &lt;list&gt;
                &lt;value type="java.lang.Class"&gt;main.com.mpakhomov.chat.domain.User&lt;/value&gt;
                &lt;value type="java.lang.Class"&gt;main.com.mpakhomov.chat.domain.ChatMessage&lt;/value&gt;
            &lt;/list&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;prop key="hibernate.hbm2ddl.auto"&gt;${hibernate.hbm2ddl.auto}&lt;/prop&gt;
                &lt;prop key="hibernate.connection.pool_size"&gt;${hibernate.connection.pool_size}&lt;/prop&gt;
            &lt;/props&gt;
        &lt;/property&gt;
    &lt;/bean&gt;
</code></pre>

<p>this is the complete stacktrace of the error that am i having when I try to launch my application.</p>

<pre><code>Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Class'; nested exception is java.lang.IllegalArgumentException: Cannot find class [main.com.mpakhomov.chat.domain.User]
    at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:74)
    at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:39)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:187)  
</code></pre>

<p>Assuming the class is defined in the package, please what could be wrong when I launch my application?</p>