[英]hibernate4.LocalSessionFactoryBean cannot be cast to org.hibernate.cfg.Configuration
[英]package org.hibernate.cfg does not exist import org.hibernate.cfg.Configuration;
我正在使用 hibernate 并且在编译过程中出现此错误:
package org.hibernate.cfg does not exist
import org.hibernate.cfg.Configuration;
您是否在构建路径中添加了休眠 jar。 因为编译器无法找到包含此包的 jar。 所以添加它并尝试。 你用的是什么IDE??
您的类路径中似乎没有 hibernate.jar。
将以下依赖项添加到您的 pom.xml 文件,保存,Maven 将完成剩下的工作:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.5.3.Final</version>
</dependency>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.