PDA

View Full Version : session factory problem



mubeen_fg
Aug 21st, 2008, 11:58 PM
Hi Everyone,

I am getting following exception when run application.

Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in class path resource [spring-session-factory.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.hibernate.cfg.Configuration]: Constructor threw exception; nested
exception is java.lang.IncompatibleClassChangeError

I defeined my session factory like this.


<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean">
<property name="dataSource">
<ref local="managedDataSource"/>
</property>

<property name="mappingResources">
<list>
<value>com/fortunalobal/hibernate/model/User.hbm.xml</value>
<value>com/fortunalobal/hibernate/model/PhoneNumber.hbm.xml</value>
</list>
</property>

<!-- Set the type of database; changing this one property will port
this to Oracle, MS SQL, hsqldb etc. -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<!--
<prop key="hibernate.hbm2dll.auto">${hibernate.hbm2dll.auto}</prop>
-->
<!-- Disable the second-level cache -->
<prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
</props>

</property>
</bean>

Please help me on this.

Mark Fisher
Aug 22nd, 2008, 07:10 AM
This forum is for the Spring Integration project. Please post this question in the Data Access forum.