Cannot find class [org.springframework.orm.hibernate5.LocalSessionFactoryBean]

报错:

org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.orm.hibernate5.LocalSessionFactoryBean] for bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibernate5.LocalSessionFactoryBean

因为没有加入spring-orm jar包。maven项目就添加:

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

其他项目添加对应版本的spring-orm jar包,
注意:版本要一致。

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页