views:

464

answers:

4

Hi

I am trying to use Hibernate+Spring in my application but stuck into following error:

java.lang.ClassNotFoundException: org.springframework.orm.hibernate.HibernateTransactionManager

Tired of googling, could any stackoverflower tell me which JAR contains the above class?

EDIT

An important thing that I did not notice was that Spring has different packages for different versions of Hibernate. For Hibernate V3 (which I am using), the appropriate HibernateTransactionManager class would be

org.springframework.orm.hibernate3.HibernateTransactionManager

instead of

org.springframework.orm.hibernate.HibernateTransactionManager.

The JAR containing this (hibernate3) class, as I have discovered is spring-hibernate3.jar. Thank you for your replies :)

+1  A: 

its in spring-orm.jar . Also make sure that you have this JAR in your classpath

TuxGeek
I do have spring-orm.jar in my classpath, but still getting the same ClassNotFoundException :(
craftsman
A: 

Umar, I see you use ant, have you tried maven? you just include dependency :

<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>${spring.version}</version>
        </dependency>

And maven take care downloading and everything for you,

c0mrade
A: 

If you're using Eclipse there's a very useful plugin called JAR Class Finder that's perfect for these type of problems.

Adrian
+1  A: 

Jarvana is a nice resource for this type of questions:

Search class: dorg.springframework.orm.hibernate.HibernateTransactionManager

sfussenegger
@sfussenegger +1 m8 I didn't know about this ..
c0mrade