Hi,
I am trying to read my hibernate.cfg.xml as an input stream
Code:
sessionFactory = new Configuration()
.addInputStream(getMapping())
.buildSessionFactory();
this is how I do the getMapping():
Code:
public InputStream getMapping()
{
return this.getClass().getResourceAsStream("/cfg/hibernate.cfg.xml");
}
But this will throw:
[tcp-connection-1][common.OPDGLogger][debug],2004-05-16 15:51:01,918 - INIT SESSION FACTORY80156 [tc
p-connection-1] DEBUG Forum.component.TopicBean - INIT SESSION FACTORY
[tcp-connection-1][net.sf.hibernate.cfg.Configuration][addInputStream],2004-05-16 15:51:01,988 - Could not configure datastore from input streamorg.dom4j.DocumentException: null Nested exception: null
at org.dom4j.io.SAXReader.read(SAXReader.java:358)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:281)
at common.HibernateDBUtil.initFactory(HibernateDBUtil.java:100)
at common.HibernateDBUtil.getSession(HibernateDBUtil.java:52) ...
Any help is greatly appreaciated.
Thanks,
inoel
[/code]