0 Replies Latest reply on Oct 9, 2014 3:30 AM by Fisayo Omotayo

    org.hibernate.internal.SessionFactoryImpl cannot be cast to org.hibernate.SessionFactory

    Fisayo Omotayo Newbie

      Hello All, I am upgrading one of our applications from jboss 4.0.5 GA to Jboss 7.1.1, and I am encountering the exception below:

       

      org.hibernate.internal.SessionFactoryImpl cannot be cast to org.hibernate.SessionFactory

      java.lang.ClassCastException: org.hibernate.internal.SessionFactoryImpl cannot be cast to org.hibernate.SessionFactory

       

      My persistence.xml is:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

          <persistence-unit name="XXModelPU">

              <description>XXModelPU</description>

              <jta-data-source>java:/GTDB</jta-data-source>

              <properties>

                  <property name="hibernate.session_factory_name" value="java:/hibernate/GTDSessionFactory"/>

                  <property name="hibernate.hbm2ddl.auto" value="update" />

                  <property name="hibernate.show_sql" value="false" />

                  <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>

                  <property name="hibernate.cache.use_second_level_cache" value="false"/>

              </properties>

          </persistence-unit>

      </persistence>

       

      Hibernate3 was used for the development of the application.

      Kindly help figure out what the issue is...