Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# MarcelloP 6/8/2007 7:44 AM (edited 6/8/2007 7:59 AM)
I'm trying to use Ayende's NHQA with Cuyahoga.Core.dll assembly and mapping files, but I get always this exception:

---------------------------
Error
---------------------------
NHibernate.MappingException: Cuyahoga.Core.Domain.ModuleType.hbm.xml(2,2): XML validation error: Could not find schema information for the element 'urn:nhibernate-mapping-2.0:hibernate-mapping'. ---> System.Xml.Schema.XmlSchemaException: Could not find schema information for the element 'urn:nhibernate-mapping-2.0:hibernate-mapping'.

--- End of inner exception stack trace ---
at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)
at NHibernate.Cfg.Configuration.ValidationHandler(Object o, ValidationEventArgs args)
at System.Xml.Schema.BaseValidator.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity)
at System.Xml.Schema.BaseValidator.SendValidationEvent(String code, String msg, XmlSeverityType severity)
at System.Xml.Schema.XsdValidator.ProcessElement(Object particle)
at System.Xml.Schema.XsdValidator.ValidateElement()
at System.Xml.Schema.XsdValidator.Validate()
at System.Xml.XmlValidatingReaderImpl.ProcessCoreReaderEvent()
at System.Xml.XmlValidatingReaderImpl.Read()
at System.Xml.XmlValidatingReader.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at NHibernate.Cfg.Configuration.LoadMappingDocument(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)
at Ayende.NHibernateQueryAnalyzer.ProjectLoader.RemoteProject.LoadAssemblies(IList assembliesToLoad)
at Ayende.NHibernateQueryAnalyzer.ProjectLoader.RemoteProject.BuildInternalProject(IList assemblies, IList mappings, IList configurations, IList basePaths)
at Ayende.NHibernateQueryAnalyzer.ProjectLoader.RemoteProject.BuildInternalProject(IList assemblies, IList mappings, IList configurations, IList basePaths)
at Ayende.NHibernateQueryAnalyzer.Core.Model.Project.BuildProject()
at Ayende.NHibernateQueryAnalyzer.UserInterface.Commands.BuildProjectCommand.Execute()


Does anyone can help me?
Thks

MarcelloP


UPD: ops, sorry, I find it myself, NHQA was expecting the 2.2 verion of the mappings!
# MarcelloP 6/8/2007 8:11 AM
Ok, now the REAL error using NHQA with Cuyahoga (upgraded to NH 1.2):

NHibernate.MappingException: Could not compile the mapping document: E:\dev\Projects\Cuyahoga\Cuyahoga\Core\Domain\User.hbm.xml ---> NHibernate.DuplicateMappingException: Duplicate collection role mapping Cuyahoga.Core.Domain.User.Roles
at NHibernate.Cfg.Mappings.AddCollection(Collection collection)
at NHibernate.Cfg.HbmBinder.PropertiesFromXML(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)
--- End of inner exception stack trace ---
at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)
at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name)
at NHibernate.Cfg.Configuration.AddXmlFile(String xmlFile)
at Ayende.NHibernateQueryAnalyzer.ProjectLoader.RemoteProject.LoadMappings(IList mappings)
at Ayende.NHibernateQueryAnalyzer.ProjectLoader.RemoteProject.BuildInternalProject(IList assemblies, IList mappings, IList configurations, IList basePaths)
at Ayende.NHibernateQueryAnalyzer.ProjectLoader.RemoteProject.BuildInternalProject(IList assemblies, IList mappings, IList configurations, IList basePaths)
at Ayende.NHibernateQueryAnalyzer.Core.Model.Project.BuildProject()
at Ayende.NHibernateQueryAnalyzer.UserInterface.Commands.BuildProjectCommand.Execute()

The mapping User.hbm.xml seems correct, so I don't understand the DuplicateMappingException......
# MarcelloP 6/25/2007 7:52 AM
I still have the NHibernate.DuplicateMappingException!
Please, anyone may give me some tips?

# martijnb 6/25/2007 9:16 AM
Unfortunately, I don't have any experience with the NHQA. Maybe you can contact Ayende directly and point him to the issue?
# Yeorwned 9/16/2009 7:56 PM
In case someone else runs into this, you may have to update the xml namespace from urn:nhibernate-mapping-2.0 to urn:nhibernate-mapping-2.2 to resolve the runtime error. I tried to post the exact lines to change but the forums returned a 500 error everytime stating the code block was hazardous.
# Yeorwned 9/16/2009 8:03 PM
I also should note the public methods in Cuyahoga.Modules.ContactUs.Domain.Contact should be virtual.
# big_al 9/18/2009 6:49 AM
No exceptions here... are you running the latest version?

If so, contact Oren directly.
# Yeorwned 9/18/2009 5:19 PM
Adjusting the NHibernate mapping and setting the public methods to virtual resolved my issue. It seems to be quite a common problem when using older code with a newer project using NHibernate 2.2. Using latest for 1.6.x release for framework and all plugins.