HI,
firstlly, great product guys.
I have had some strange intermittent problems with hibernate.cfg.xml not being found in my war file by Configuration.configure(). I would like to use getResourceAsStream to load the hibernate.cfg.xml file myself instead of leaving it to Configuration.configure(). I have been trying to use Configuration.addInputStream(InputStream is) however this results in no mappings being built whatsoever. The only way I had any success is to change
protected Configuration doConfigure(InputStream stream, String resourceName)
to be a public method which I call from my initialisation servlet - this results in all the mappings being correctly built, eg
new Configuration().doConfigure(in, "hibernate.cfg.xml").buildSessionFactory()
Is there any way I can do this without making this change to Configuration.java. I would have thought that the addInputStream() method above should go on and call doConfigure() ? I think I have probably missed something here.
Thanks, Tom.
|