我正在尝试将Spring 4与Hibernate 4集成,并且我正在使用eclipse ide而没有maven依赖项,但是我得到了下面提到的错误:
由: java.lang.classnotfoundexception : org.hibernate.annotations.Entity
如果有人已经实现并且工作正常,那么请您分享该项目以供参考,以便我了解集成的流程,因为我是春天和冬眠的新手。我需要一些好的指导。
你需要使用一些依赖关系,你可以在下面找到:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.5-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.2.9.Final</version>
</dependency>
如果您不使用Maven项目,则需要下载hibernate-entitymanager
并hibernate-annotations
jar并添加到构建路径中并重建项目