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: ASP.NET 2,VWD Express,nHibernate 1.2.0 Alpha (Newbie)
PostPosted: Tue Aug 01, 2006 7:50 am 
Newbie

Joined: Tue Aug 01, 2006 3:42 am
Posts: 1
I created a Class Project using Visual C# Express which has the Persistent Class file as well as the hbm file as embedded resource, and referenced the DLL in Visual Web Express (as suggested by people on the forum).

However i get a error like this :-

Could not find schema information for the element 'urn:NHibernate-mapping-2.0:hibernate-mapping'.

I am new to nHibernate. Please help.

Thanks.

Hibernate version:
1.2.0.1001

Mapping documents:
?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:NHibernate-mapping-2.0">
<class name="NHibernate.Examples.QuickStart.User, NHibernate.Examples" table="users">
<id name="Id" column="LogonId" type="String" length="20">
<generator class="assigned" />
</id>
<property name="UserName" column="Name" type="String" length="40"/>
<property name="Password" type="String" length="20"/>
<property name="EmailAddress" type="String" length="40"/>
<property name="LastLogon" type="DateTime"/>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
ISession session = factory.OpenSession();
ITransaction transaction = session.BeginTransaction();

NHibernate.Examples.QuickStart.User newUser = new NHibernate.Examples.QuickStart.User();
newUser.Id = "joe_cool";
newUser.UserName = "Joseph Cool";
newUser.Password = "abc123";
newUser.EmailAddress = "joe@cool.com";
newUser.LastLogon = DateTime.Now;

// Tell NHibernate that this object should be saved
session.Save(newUser);

// commit all of the changes to the DB and close the ISession
transaction.Commit();
session.Close();


Full stack trace of any exception that occurs:
[XmlSchemaException: Could not find schema information for the element 'urn:NHibernate-mapping-2.0:hibernate-mapping'.]
NHibernate.Cfg.Configuration.ValidationHandler(Object o, ValidationEventArgs args) in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:1562
System.Xml.Schema.BaseValidator.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) +58
System.Xml.Schema.BaseValidator.SendValidationEvent(String code, String msg, XmlSeverityType severity) +127
System.Xml.Schema.XsdValidator.ProcessElement(Object particle) +311
System.Xml.Schema.XsdValidator.ValidateElement() +192
System.Xml.Schema.XsdValidator.Validate() +68
System.Xml.XmlValidatingReaderImpl.ProcessCoreReaderEvent() +125
System.Xml.XmlValidatingReaderImpl.Read() +44
System.Xml.XmlValidatingReader.Read() +12
System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) +791
System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +51
System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +278
System.Xml.XmlDocument.Load(XmlReader reader) +97
NHibernate.Cfg.Configuration.LoadMappingDocument(XmlTextReader hbmReader) in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:1539
NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader hbmReader) in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:1556
NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream) in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:416

[MappingException: Could not find schema information for the element 'urn:NHibernate-mapping-2.0:hibernate-mapping'.]
NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream) in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:426
NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly, Boolean skipOrdering) in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:598
NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly) in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:552
NHibernate.Cfg.Configuration.AddAssembly(String assemblyName) in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:533
_Default.Page_Load(Object sender, EventArgs e) +41
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +45
System.Web.UI.Control.OnLoad(EventArgs e) +80
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3743



Name and version of the database you are using:

SQL 2005 Express
Connection string :-

The generated SQL (show_sql=true):


Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 8:54 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Code:
<hibernate-mapping xmlns="urn:NHibernate-mapping-2.0">
should be
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
- it's case-sensitive.


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.