首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到hibernate.cfg.xml (intellij/maven)

找不到hibernate.cfg.xml (intellij/maven)
EN

Stack Overflow用户
提问于 2020-05-06 03:40:34
回答 1查看 29关注 0票数 0

所以我在intellij中运行了一个hibernate项目,但是因为我添加了一个module-info,所以hibernate找不到配置。enter image description here

正如您在上面看到的,配置在资源中,而它应该在maven项目中。删除module-info不会改变任何东西。这是我的module-info:

代码语言:javascript
复制
module ProjektRechnungsprogramm {
requires java.persistence;
requires java.sql;
requires org.hibernate.orm.core;
requires java.naming;
requires net.bytebuddy;
requires org.hibernate.commons.annotations;}

即使我尝试getClass.getResource("hibernate.cfg.xml"),它也返回null。

EN

回答 1

Stack Overflow用户

发布于 2020-05-06 03:50:39

您已将配置放在utils目录中,因此请使用以下命令获取资源

getClass.getResource("Utils/hibernate.cfg.xml")

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61621637

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档