firends im は netbeans ide を使用し、hibernate.cfg.xml をデフォルトの src/java フォルダーに配置しましたが、アプリケーションを実行するたびにエラーの下に表示されます:
Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found
クラス :
public class myutil {
private static final SessionFactory sessionFactory = buildsf();
public static SessionFactory buildsf() {
try {
// Create the SessionFactory from standard (hibernate.cfg.xml)
return new Configuration().configure("config/hibernate.cfg.xml").buildSessionFactory();
} catch (Throwable ex) { // Log the exception.
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
}