我有一个java项目,我正在使用hibernate。这里的事情是我想将hibernate.cfg.xml文件放在“src”文件夹之外,但是当我配置这个文件时它显示FileNotFoundException。如果我把它放在 src 文件夹中就可以了。但我想将 java src 和所有配置文件分开放在单独的文件夹中。
root
|____src
|____conf
|____mapping
|____(all xml file with hibernate.cfg.xml)
SessionFactory _sessionFactory = (new Configuration()).configure("./conf/mapping/hibernate.cfg.xml").buildSessionFactory();
它的显示异常......