【发布时间】:2013-10-27 00:26:06
【问题描述】:
我想将我的 java 项目(使用 eclipse)导出到可执行的 jar 中, 但我希望 hibernate.cfg.xml、config.properties 和 log4j.properties 将来可以编辑, 那么如何从外部项目文件夹中休眠访问该文件或以任何其他方式使该文件可编辑以备将来使用,
我已经尝试从外部项目文件夹访问 hibernate.cfg.xml 的代码
SessionFactory sessionFactory = new Configuration().configure("mon/hibernate.cfg.xml").buildSessionFactory();
但我收到了这个错误
mon/hibernate.cfg.xml not found
Exception in thread "main" java.lang.ExceptionInInitializerError
仍然不知道 config.properties 和 log4j.properties, 任何帮助都会很高兴:)
【问题讨论】:
标签: java xml eclipse hibernate