Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
org.hibernate.impl.SessionFactoryImpl' to required type 'com.liferay.portal
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
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
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™