-->
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: Problem with BuildSessionFactory
PostPosted: Thu Nov 16, 2006 6:56 pm 
Newbie

Joined: Thu Nov 16, 2006 6:45 pm
Posts: 2
Hello,

I am getting the following exception while excuting the code:

sessionFactory = new Configuration().Configure("C:\\\\Projects\\Web\\hibernate.cfg.xml").BuildSessionFactory();

Exception: <session-factory> element was not found in the configuration file.]
MobileAudit.Persistence.HibernateUnitOfWork..ctor() in C:\Mobile-Audit\Projects\ASP.NET POC\Mobile-Audit.Persistence\HibernateUnitOfWork.cs:35
MobileAudit.Persistence.HibernateUnitOfWork.NewUnitOfWork() in C:\Mobile-Audit\Projects\ASP.NET POC\Mobile-Audit.Persistence\HibernateUnitOfWork.cs:42
MobileAudit.Persistence.HibernateUnitOfWork.GetUnitOfWork() in C:\Mobile-Audit\Projects\ASP.NET POC\Mobile-Audit.Persistence\HibernateUnitOfWork.cs:52
MobileAudit.Persistence.HibernatePersistence.Load(IPersistableObject po) in C:\Mobile-Audit\Projects\ASP.NET POC\Mobile-Audit.Persistence\HibernatePersistence.cs:23
MobileAudit.Persistence.PersistableDomainObjectBase.Load() in C:\Mobile-Audit\Projects\ASP.NET POC\Mobile-Audit.Persistence\PersistableDomainObjectBase.cs:21
_Default.Page_Load(Object sender, EventArgs e) in c:\Mobile-Audit\Projects\ASP.NET POC\Default.aspx.cs:18
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +31
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +68
System.Web.UI.Control.OnLoad(EventArgs e) +88
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3035
------------------------------------------------------------------------------------

The hibernate.cfg.xml file looks like the following:
<?xml version='1.0' encoding='utf-8'?>

<hibernate-configuration xmlns="urn:hibernate-configuration-2.2">


<session-factory>

<!-- properties -->
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Data Source=vlad-rdalaptop\sqlexpress;initial catalog=HIBERNATE-POC;</property>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="use_outer_join">true</property>

<mapping resource="Authority.hbm.xml" assembly="MobileAudit.Domain"/>
<mapping resource="Organization.hbm.xml" assembly="MobileAudit.Domain"/>

</session-factory>

</hibernate-configuration>


Hibernate version:1.2.0-Beta2


Any help will be greatly appreciated.
Vlad.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 7:33 pm 
Newbie

Joined: Thu Nov 16, 2006 6:45 pm
Posts: 2
I found the problem.

Had to use
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">

(nhibernate)
not

<hibernate-configuration xmlns="urn:hibernate-configuration-2.2">


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.