org.hibernate.impl.SessionFactoryImpl' to required type 'com.liferay.portal

Pankaj Kumar, modified 5 Years ago. Regular Member Posts: 101 Join Date: 7/27/14 Recent Posts
Hi All,I am using Liferay DXP 7.2 and i am trying to inject the session factory object in entity Persistence classes.But i am getting below error.
Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.hibernate.impl.SessionFactoryImpl' to required type 'com.liferay.portal.kernel.dao.orm.SessionFactory' for property 'sessionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'org.hibernate.impl.SessionFactoryImpl' to required type 'com.liferay.portal.kernel.dao.orm.SessionFactory' for property 'sessionFactory': no matching editors or conversion strategy found
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)

ext.spring.xml<bean class="com.liferay.portal.spring.hibernate.PortalHibernateConfiguration" id="customSessionFactory">
        <property name="dataSource" ref="liferayDataSource" />
    </bean>
    <bean class="com.liferay.portal.spring.transaction.TransactionManagerFactory" factory-method="createTransactionManager" id="crmTransaction">
        <constructor-arg ref="liferayDataSource" />
        <constructor-arg ref="customSessionFactory" />
    </bean>

Service.xml<entity local-service="true" name="Foo" remote-service="true" uuid="true" data-source="extDataSource" session-factory="customSessionFactory" tx-manager="crmTransaction" >
Please tell me how i can proceed from here.
ThanksPAnkaj Semwal