<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>org.hibernate.impl.SessionFactoryImpl' to required type 'com.liferay.portal</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118130935" />
  <subtitle>org.hibernate.impl.SessionFactoryImpl' to required type 'com.liferay.portal</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118130935</id>
  <updated>2026-04-04T01:43:37Z</updated>
  <dc:date>2026-04-04T01:43:37Z</dc:date>
  <entry>
    <title>org.hibernate.impl.SessionFactoryImpl' to required type 'com.liferay.portal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118130934" />
    <author>
      <name>Pankaj Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118130934</id>
    <updated>2019-12-19T19:41:27Z</updated>
    <published>2019-12-19T19:41:27Z</published>
    <summary type="html">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.&lt;br /&gt;Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type &amp;#39;org.hibernate.impl.SessionFactoryImpl&amp;#39; to required type &amp;#39;com.liferay.portal.kernel.dao.orm.SessionFactory&amp;#39; for property &amp;#39;sessionFactory&amp;#39;; nested exception is java.lang.IllegalStateException: Cannot convert value of type &amp;#39;org.hibernate.impl.SessionFactoryImpl&amp;#39; to required type &amp;#39;com.liferay.portal.kernel.dao.orm.SessionFactory&amp;#39; for property &amp;#39;sessionFactory&amp;#39;: no matching editors or conversion strategy found&lt;br /&gt;    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)&lt;br /&gt;&lt;br /&gt;ext.spring.xml&amp;lt;bean class=&amp;#34;com.liferay.portal.spring.hibernate.PortalHibernateConfiguration&amp;#34; id=&amp;#34;customSessionFactory&amp;#34;&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;#34;dataSource&amp;#34; ref=&amp;#34;liferayDataSource&amp;#34; /&amp;gt;&lt;br /&gt;    &amp;lt;/bean&amp;gt;&lt;br /&gt;    &amp;lt;bean class=&amp;#34;com.liferay.portal.spring.transaction.TransactionManagerFactory&amp;#34; factory-method=&amp;#34;createTransactionManager&amp;#34; id=&amp;#34;crmTransaction&amp;#34;&amp;gt;&lt;br /&gt;        &amp;lt;constructor-arg ref=&amp;#34;liferayDataSource&amp;#34; /&amp;gt;&lt;br /&gt;        &amp;lt;constructor-arg ref=&amp;#34;customSessionFactory&amp;#34; /&amp;gt;&lt;br /&gt;    &amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;Service.xml&amp;lt;entity local-service=&amp;#34;true&amp;#34; name=&amp;#34;Foo&amp;#34; remote-service=&amp;#34;true&amp;#34; uuid=&amp;#34;true&amp;#34; data-source=&amp;#34;extDataSource&amp;#34; session-factory=&amp;#34;customSessionFactory&amp;#34; tx-manager=&amp;#34;crmTransaction&amp;#34; &amp;gt;&lt;br /&gt;Please tell me how i can proceed from here.&lt;br /&gt;ThanksPAnkaj Semwal</summary>
    <dc:creator>Pankaj Kumar</dc:creator>
    <dc:date>2019-12-19T19:41:27Z</dc:date>
  </entry>
</feed>
