Hello,
I feel really stupid for asking, but I cannot read the config file on startup.
It is there with permissions. but I can't seem to load it.
I run Ecipse 3.0 release and when firing up I get the exception below.:
Code:
public static void initialize (String configFileName) throws HibernateException {
if (null == configFileName && sessionFactoryMap.size() > 0) return;
else if (null != sessionFactoryMap.get(configFileName)) return;
else {
Configuration cfg = new Configuration();
if (null == configFileName)
cfg.configure();
else
cfg.configure(configFileName);
setSessionFactory(configFileName, cfg.buildSessionFactory());
}
}
I am using
Hibernate version: 2.1
Full stack trace of any exception that occurs:
Aug 17, 2004 12:29:52 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.6
Aug 17, 2004 12:29:52 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Aug 17, 2004 12:29:52 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Aug 17, 2004 12:29:52 AM net.sf.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
Aug 17, 2004 12:29:52 AM net.sf.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
Aug 17, 2004 12:29:52 AM net.sf.hibernate.cfg.Configuration getConfigurationInputStream
WARNING: /hibernate.cfg.xml not found
Exception in thread "main" net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
at net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:872)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:896)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
at se.fbio.hib.base._BaseRootDAO.initialize(_BaseRootDAO.java:51)
at se.fbio.hib.base._BaseRootDAO.initialize(_BaseRootDAO.java:38)
at testHib.main(testHib.java:35)
The file is there! What could be wrong? I have also tried absolute/relative path's.
I'm stuck. Could anyone assist me in this? Am I doing something stupid?
Regards,
.../Ola