-->
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.  [ 3 posts ] 
Author Message
 Post subject: WebApp Configuration Problem... please help (please please)
PostPosted: Thu May 26, 2005 7:59 am 
Newbie

Joined: Thu May 26, 2005 7:25 am
Posts: 13
Hi anybody.

I'm trying to write my first web application with NHibernate. We already have a nice architecture based on three main components (one project for the web, one for the framework and another one for the business classes).

The DAO layer (the methods for accessing database) are located in both framework and business projects. I should be able to configure NHibernate from the framework project, but it seems there is a problem in such approach becouse any attempt to execute the line

config = new Configuration();

throws a nasty exception:

log4net:ERROR DOMConfigurator: ConfigureFromXML called with null 'element' parameter


We don't have any idea about how to deal with it and we are becoming increasingly frustrated. Could you be so nice to help us?

If you need further details please feel free to ask me. Thank you in advance.

jv (jv at e-chiceros dddoott com)


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 8:31 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This should not be an exception, it's just a log message from log4net which will go away if you configure log4net in your app.config. But it's harmless.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 27, 2005 7:19 am 
yes, it was a log4net configuration problem. Once resolved was quite easy to locate the real problem: the hibernate.cfg.xml was not being loaded.

We have added the file to the Framework project and we load it with those lines:

Configuration config = new Configuration();

System.Reflection.Assembly assembly =
System.Reflection.Assembly.GetAssembly(typeof(DAO));

System.IO.Stream stream =
assembly.GetManifestResourceStream("Framework.hibernate.cfg.xml");

System.Xml.XmlTextReader reader =
new System.Xml.XmlTextReader(stream);

config.Configure(reader);

Thanks everybody for the support.

jv


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

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.