Thanks for your interest!
The most outer exception is:
Code:
{"Could not compile the mapping document: Hmm.DTO.Core.AspNet.mappings.Events.hbm.xml"}
thrown by NHibernate, with this stack trace:
Code:
at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)
at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name)
at NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader hbmReader, String name)
at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)
at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)
at NHibernate.Cfg.Configuration.AddResources(Assembly assembly, IList resources, Boolean skipOrdering)
at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly, Boolean skipOrdering)
at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)
at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
at Hmm.DAO.Common.NHibernateSessionManager.InitSessionFactory(String[] assemblies) in c:\moje\Programowanie\agro\Hmm\DAL\Common\NHibernateSessionManager.cs:line 63
at Hmm.DAO.DAOManager.HmmSessionManager.BeginTransaction(Object sender, EventArgs e) in c:\moje\Programowanie\agro\Hmm\DAL\DAOManager\HmmSessionManager.cs:line 20
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
while the only inner exception is:
Code:
{"Namespace prefix 'hbm' is not defined."}
thrown by:
Code:
at MS.Internal.Xml.XPath.CompiledXpathExpr.UndefinedXsltContext.LookupNamespace(String prefix)
at MS.Internal.Xml.XPath.BaseAxisQuery.SetXsltContext(XsltContext context)
at MS.Internal.Xml.XPath.CompiledXpathExpr.SetContext(XmlNamespaceManager nsManager)
at System.Xml.XmlNode.SelectSingleNode(String xpath, XmlNamespaceManager nsmgr)
at NHibernate.Cfg.HbmBinder.HandleCustomSQL(XmlNode node, PersistentClass model)
at NHibernate.Cfg.HbmBinder.BindClass(XmlNode node, PersistentClass model, Mappings mappings)
at NHibernate.Cfg.HbmBinder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
at NHibernate.Cfg.HbmBinder.BindRoot(XmlDocument doc, Mappings mappings)
at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name)
The xml file itself:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Hmm.DTO.Core" namespace="Hmm.DTO.Core.AspNet.WebEvents">
<class name="Events" table="aspnet_WebEvent_Events">
<id name="EventId" column="EventId" type="System.String">
<generator class="assigned"/>
</id>
<property column="EventTimeUtc" type="System.DateTime" name="EventTimeUtc" not-null="true" />
....
</class>
</hibernate-mapping>
It is very annoying. This hbm.xml document is not the only one that throws the same exception - it looks like random classes at random time throws the exception. I'm using ASP.NET 2.0 + AJAX web extensions and SQL 2005 EXPRESS. NHibernate is 1.2. All of my mapping files are marked as Embeded Content.[/code]