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.  [ 2 posts ] 
Author Message
 Post subject: Please help, Unable to load mapping files...
PostPosted: Sat Mar 01, 2008 8:00 am 
Newbie

Joined: Sat Mar 01, 2008 7:52 am
Posts: 1
I used this statement to load the mapping file.

Configuration cfg = new Configuration().AddXmlFile("ParameterRepository.hbm.xml");

However it said that missing the hibernate.dialect...

Here is the error message:

/*
1) Castor.Installation.Parameter.UsageDemoUnitTestCase.Demo2 : NHibernate.MappingException : Could not compile the mapping document: ParameterRepository.hbm.xml
----> NHibernate.HibernateException : The dialect was not set. Set the property hibernate.dialect.
at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
at NHibernate.Cfg.Configuration.ProcessMappingsQueue()
at NHibernate.Cfg.Configuration.AddXmlFile(String xmlFile)
at Castor.Installation.Parameter.UsageDemoUnitTestCase.Demo2() in e:\cstcs\installation_parameter_management_1.0_dev_dist\src\csharp\tests\Castor\Installation\Parameter\Demo.cs:line 38
--MappingException
at NHibernate.Dialect.Dialect.GetDialect()
at NHibernate.Dialect.Dialect.GetDialect(IDictionary props)
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
*/

If I simply use

/*
_sessionFactory = new Configuration().Configure().BuildSessionFactory();
*/

it works, as I placed those configurations in the hybernate.cfg.xml.
But the mapping files are not loaded...

I was wondering why the first approach doesn't work??

Could anyone please give me some instructions?
Thanks very very very very much!


Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 01, 2008 10:10 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Have you set "Build Action" to "Embedded Ressource for the configuration file ? And btw the name should be "hibernate.cfg.xml" not "hybernate.cfg.xml", but that might just be a typo in the post.

_________________
--Wolfgang


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.