spring - org.springframework.beans.TypeMismatchException -
getting type mismatch exception. project spring , hibernate integration , getting error as
caused by: org.springframework.beans.typemismatchexception: failed convert property value of type 'java.util.arraylist' required type 'java.lang.class[]' property 'annotatedclasses'; nested exception java.lang.illegalargumentexception: cannot find class [com.vrnda.hibernatemappingfile.projectdetails]
sdnext-servlet.xml is
<?xml version="1.0" encoding="utf-8"?> < beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:mongo="http://www.springframework.org/schema/data/mongo" xsi:schemalocation=" 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 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd"> <context:component-scan base-package="com" /> <tx:annotation-driven transaction-manager="hibernatetransactionmanager"/> <mvc:annotation-driven /> <mvc:resources mapping="/images/**" location="/images/**" cache-period="31556926"/> <mvc:resources mapping="/scripts/**" location="/scripts/**" cache-period="31556926"/> <mvc:resources mapping="/css/**" location="/css/**" cache-period="31556926"/> <mvc:resources mapping="/resources/**" location="/**/resources/**,classpath:/meta-inf/web-resources/**" cache-period="31556926"/> <bean class="org.springframework.web.servlet.mvc.support.controllerclassnamehandlermapping"/> <bean id="defaultcontroller" class="org.springframework.web.servlet.mvc.parameterizableviewcontroller"> <property name="viewname" value="default" /> </bean> <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="com.mysql.jdbc.driver" /> <property name="url" value="jdbc:mysql://localhost:3306/projectmanagementtool2" /> <property name="username" value="root" /> <property name="password" value="root" /> </bean> <bean class="org.springframework.orm.hibernate3.annotation.annotationsessionfactorybean" id="sessionfactory"> < property name="datasource" ref="datasource"></property> < property name="packagestoscan"> < list> < value> com.hibernatemappingfile< /value> < /list> < /property> < property name="hibernateproperties"> < props> < prop key="hibernate.dialect">org.hibernate.dialect.mysqldialect</prop> < prop key="hibernate.show_sql">true</prop> < prop key="hibernate.hbm2ddl.auto">update</prop> </props> </property> < /bean> < bean class="org.springframework.orm.hibernate3.hibernatetransactionmanager" id="hibernatetransactionmanager"> < property name="sessionfactory" ref="sessionfactory"></property> < /bean> < bean id="jspviewresolver" class="org.springframework.web.servlet.view.internalresourceviewresolver"> < property name="viewclass" value="org.springframework.web.servlet.view.jstlview" /> < property name="prefix" value="/web-inf/views/" /> < property name="suffix" value=".jsp" /> </bean> < /beans>
why getting error have seen fields excatly mapped bean.still getting error.
are using hibernate 3 or hibernate 4? if 3, old project , have use 3? configuration 4 , works :
<beans:bean id="hibernate4annotatedsessionfactory" class="org.springframework.orm.hibernate4.localsessionfactorybean"> <beans:property name="datasource" ref="datasource"/> <beans:property name="packagestoscan" value="com.journaldev.spring.model"/>
the value above gives path package model files are. rest handled spring. try out, , check why using hibernate 3.
Comments
Post a Comment