-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: usage of Configuration.doConfigure() question
PostPosted: Mon May 24, 2004 2:52 am 
Newbie

Joined: Wed Dec 10, 2003 8:40 pm
Posts: 9
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.