0

I dont know why I am having the above error on this line of my code

<bean id="sessionFactory"
        class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">

this is the complete code

<bean id="sessionFactory"
        class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="configLocation">
            <value>classpath:db/hibernate.cfg.xml</value>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.show_sql">true</prop>
            </props>
        </property>
    </bean>

What could be wrong?

cihan adil seven
  • 541
  • 1
  • 4
  • 20
Blaze
  • 2,269
  • 11
  • 40
  • 82

1 Answers1

0

I had this problem long ago and this was my solution :

Hibernate 4 support was added to Spring Framework in 3.1.

Your pom.xml references Spring Framework 2.5.6 hence org.springframework.orm.hibernate4.LocalSessionFactoryBean does not exist. You need to update your pom.xml to reference Spring Framework 3.1 or later.

ref : java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean

Community
  • 1
  • 1
Mohamed Nabli
  • 1,629
  • 3
  • 17
  • 24