-->
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.  [ 3 posts ] 
Author Message
 Post subject: Exception "Could not find schema for 'nhibernate-mappin
PostPosted: Tue Jan 01, 2008 8:27 pm 
Newbie

Joined: Tue Jan 01, 2008 5:59 pm
Posts: 7
Starting as Nhibernate, with 1.2.1GA

When requesting that Configuration loads the mapping files, it throws an exception as follows: ( complete stack is at the end of this post ).

Initially, I was writing "hibernate-mapping" ( as per the user guide ); but after a look to nhibernate-mapping-2.2.xsd, I tried changing the element to nhibernate mapping.

NHibernate.MappingException was unhandled
Message="Remote(2,2): XML validation error: Could not find schema information for the element 'nhibernate-mapping'."
Source="NHibernate"
....

I don't understand what I'm doing the wrong way.

Any help would be invaluable.

TIA

Marcelo

Follows the coplete exception, and the "offending" file

NHibernate.MappingException was unhandled
Message="Remote(2,2): XML validation error: Could not find schema information for the element 'nhibernate-mapping'."
Source="NHibernate"
StackTrace:
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 Feeder_sa_test.Feeder_test.Main(String[] args) in C:\Tecmes-app\Feeder-sa-test\Feeder-test.cs:line 23


The file

<?xml version="1.0" encoding="utf-8" ?>
<nhibernate-mapping assembly="Feeder-dll" namespace="Feeder" >
<class name="Remoteterminal" table="Remoteterminal" mutable="false" >
<id name="Remoteterminalid" column="Remoteterminalid" type="Int32" unsaved-value="0"
generator="" class="native" >
</id>
<property name="Description" />
<property name="Hwversion" />
<property name="Id" />
<property name="Ipaddress" />
<property name="Name" />
<property name="Serialnumber" />
<property name="Softversion" />

</class>
</nhibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 10:39 am 
Newbie

Joined: Fri Jan 04, 2008 10:34 am
Posts: 1
The mapping file should contain a xmlns attribute like this one:

Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="...
>


Note that the value depends on the nh version, use "urn:nhibernate-mapping-2.0" for .NET 1.1 version,
"urn:nhibernate-mapping-2.2" for .NET 2.0 version,

Maybe this helps.

brix


Top
 Profile  
 
 Post subject: thank you
PostPosted: Fri Jan 04, 2008 12:06 pm 
Newbie

Joined: Tue Jan 01, 2008 5:59 pm
Posts: 7
Thank you. Seeking in the examples, I found that advice ... but don't knew why the version change.


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