英文:
Hibernate - cfg.xml Not Found in Resources
问题
Common issue but all the threads about this never managed to solve my issue.
Here's my very simple test setup:
public class HibernateSandboxApplication {
public static void main(String[] args) {
new Configuration().configure();
}
}
Project structure:
Why can't configure() find my cfg.xml in the resources folder?
英文:
Edit: Removed the spring snippets
Common issue but all the threads about this never managed to solve my issue.
Here's my very simple test setup:
public class HibernateSandboxApplication {
public static void main(String[] args) {
new Configuration().configure();
}
}
Project structure:
Why can't configure() find my cfg.xml in the resources folder?
答案1
得分: 0
你需要在applicationContext.xml中声明它。在这里查看:https://stackoverflow.com/questions/471799/spring-and-hibernate-cfg-xml
英文:
You need to declare it in the applicationContext.xml. Have a look here: https://stackoverflow.com/questions/471799/spring-and-hibernate-cfg-xml
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论