Loïc Guillois
Loïc Guillois

Reputation: 373

Configuration problem with Hibernate and Spring

I'm trying to build a Spring application with Eclipse. Since I've added the DAO layer with Hibernate this exception appear when I try to access to my web service with a browser.

Caused by: java.lang.ClassNotFoundException: org.springframework.orm.hibernate3.support.HibernateDaoSupport at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)

The Spring JAR is in the "Libraries" of the Eclipse project and Eclipse doesn't advise me about this problem.

Upvotes: 0

Views: 742

Answers (3)

Khush
Khush

Reputation: 853

These are the dependancies your need:
<dependency org="org.hibernate.javax.persistence" name="hibernate-jpa-2.0-api" rev="1.0.1.Final" conf="runtime->default;compile->default;test->default"/>   
        <dependency org="org.hibernate" name="hibernate" rev="3.5.4-Final" conf="compile->default;test->default;runtime->default"/>
        <dependency org="org.hibernate" name="hibernate-annotations" rev="3.5.4-Final" conf="runtime->default;compile->default;test->default"/>
        <dependency org="org.hibernate" name="hibernate-commons-annotations" rev="3.2.0.Final" conf="runtime->default;compile->default;test->default"/>
        <dependency org="org.hibernate" name="hibernate-validator" rev="4.2.0.Final" conf="runtime->default;compile->default;test->default"/>
<dependency org="cglib" name="cglib-nodep" rev="2.2.2" conf="runtime->default;compile->default;test->default"/>

In Ivy format.

Upvotes: 0

Jose Diaz
Jose Diaz

Reputation: 5398

More importantly, you're missing the hibernate core dependencies for your project.

See how you can get them from here.

Upvotes: 0

Bozho
Bozho

Reputation: 597016

There is not only one spring jar. For the orm classes you need the spring-orm-x.jar. You'll need spring-beans, spring-context as well.

Upvotes: 2

Related Questions