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.
|