/hibernate.cfg.xml not found
----------------------------
Key: HHH-4745
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4745
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: Windows XP; maven; hibernate-distribution-3.3.2.GA;
hibernate-entitymanager-3.4.0.GA
MS SQL Server 2008 Developer. sqljdbc4.jar (microsoft sqljdbc_2)
Reporter: Mike Bishop
no matter where I put it, no matter what the classpath, sessionFactory cannot find
hibernate.cfg.xml.
Here is the class path -
.;C:\my-app\target;C:\Hibernate\hibernate-distribution-3.3.2.GA;C:\Hibernate\hibernate-distribution-3.3.2.GA\lib\required;C:\Hibernate\hibernate-annotations-3.4.0.GA;C:\Hibernate\hibernate-entitymanager-3.4.0.GA;C:\jdbc\MSSQL\sqljdbc_2.0\enu\sqljdbc4.jar;
Here is the snippet from HibernateUtil
import org.hibernate.*;
import org.hibernate.cfg.*;
public class HibernateUtil {
private static SessionFactory sessionFactory;
static {
try {
sessionFactory = new Configuration()
.configure("hibernate.cfg.xml")
.buildSessionFactory();
}
catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed. " + ex);
throw new ExceptionInInitializerError(ex);
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira