Marvel John
Marvel John

Reputation: 193

The import org.springframework.orm.hibernate3.support.HibernateDaoSupport cannot be resolved

Hi i am trying to develope a sample project in Spring with REST. i am using Spring 4.0.0.release. to implement hibernate operations i import the import org.springframework.orm.hibernate3.support.HibernateDaoSupport but the error shows The import org.springframework.orm.hibernate3.support.HibernateDaoSupport cannot be resolved. my pom.xml includes :

<!-- Spring -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${org.springframework-version}</version>
        <exclusions>
            <!-- Exclude Commons Logging in favor of SLF4j -->
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${org.springframework-version}</version>
    </dependency>

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

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>4.0.0.RELEASE</version>
    </dependency>

    <!-- HIbernate  -->

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>5.0.0.Final</version>
    </dependency>

the link [http://docs.spring.io/autorepo/docs/spring/4.0.0.M3/javadoc-api/index.html?org/springframework/orm/hibernate3/support/HibernateDaoSupport.html][1] says that the Spring contains the class : org.springframework.orm.hibernate3.support.HibernateDaoSupport

Please help me to overcome this issue. Any help would be greatly appreciated.

Upvotes: 2

Views: 12203

Answers (2)

EpicPandaForce
EpicPandaForce

Reputation: 81549

According to the Maven Repository at http://mvnrepository.com/artifact/org.springframework/spring-orm/4.0.0.RELEASE

You should be using the following:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>4.0.0.RELEASE</version>
</dependency>


<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>4.2.2.Final</version>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.2.2.Final</version>
</dependency>

If that does not work, try 3.6.9.Final for hibernate version.

Upvotes: 5

Melvins
Melvins

Reputation: 330

  1. Make sure to integrate Maven in Eclipse. In Windows -> preferences -> Maven -> User Settings, provide the settings.xml and see whether the local repository is the same as that of the local repository where the downloads of these jars are occurring.
  2. Please use spring framework version 4.2.1.RELEASE and hibernate version 5.0.1.Final

This should probably help. Else, try restarting the eclipse, or do a manual install.

Please let know if it works.

Upvotes: 0

Related Questions