Hi
Does anyone here use NHibernate under Mono? I've encountering an obscure error with even the simplest attempts. It seems to attempt validate my config file against some schema and fails.
==============================================================
Code:
using NHibernate;
using NHibernate.Cfg;
public class NhThing {
public static void Main(string[] args) {
NhThing nhThing = new NhThing();
}
public NhThing() {
Configuration cfg = new Configuration();
ISessionFactory sessionFactory = cfg.Configure().BuildSessionFactory();
}
}
==============================================================
Code:
Unhandled Exception: NHibernate.HibernateException: problem parsing configuration : System.Xml.Schema.XmlSchemaValidationException: XmlSchema error: Element declaration for configuration is missing. XML URI: file:///home/steve/tmp/NHThing/build/hibernate.cfg.xml . Line 2, Position 2.
at System.Xml.XmlValidatingReader.OnValidationEvent (System.Object o, System.Xml.Schema.ValidationEventArgs e) [0x00000]
at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_ValidationEventArgs (object,System.Xml.Schema.ValidationEventArgs)
at Mono.Xml.Schema.XsdValidatingReader.HandleError (System.Xml.Schema.XmlSchemaValidationException schemaException, Boolean isWarning) [0x00000]
at Mono.Xml.Schema.XsdValidatingReader.HandleError (System.String error, System.Exception innerException, Boolean isWarning) [0x00000]
at Mono.Xml.Schema.XsdValidatingReader.HandleError (System.String error, System.Exception innerException) [0x00000]
at Mono.Xml.Schema.XsdValidatingReader.HandleError (System.String error) [0x00000]
at Mono.Xml.Schema.XsdValidatingReader.AssessStartElementSchemaValidity () [0x00000]
at Mono.Xml.Schema.XsdValidatingReader.Read () [0x00000]
at System.Xml.XmlValidatingReader.Read () [0x00000]
at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00000]
at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x00000]
at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) [0x00000]
at NHibernate.Cfg.Configuration.Configure (System.Xml.XmlTextReader reader) [0x00000]
at NHibernate.Cfg.Configuration.Configure (System.Xml.XmlTextReader reader) [0x00000]
at NHibernate.Cfg.Configuration.Configure (System.String resource) [0x00000]
at NHibernate.Cfg.Configuration.Configure () [0x00000]
at NhThing..ctor () [0x00000]
at NhThing.Main (System.String[] args) [0x00000]
==============================================================
hibernate.cfg.xml
==============================================================
Code:
<?xml version="1.0" ?>
<configuration>
<configSections>
<section
name="nhibernate"
type="System.Configuration.NameValueSectionHandler,
System, Version=1.0.5000.0,Culture=neutral,
PublicKeyToken=b77a5c561934e089"
/>
</configSections>
<nhibernate>
<add
key="hibernate.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider"
/>
<add
key="hibernate.connection.driver_class"
value="NHibernate.Driver.MySqlDataDriver"
/>
<add
key="hibernate.connection.connection_string"
value="Server=localhost;Database=hvhs_account_manager_test;UserID=dev;Password=;"
/>
<add
key="hibernate.dialect"
value="NHibernate.Dialect.MySQLDialect"
/>
</nhibernate>
</configuration>