Hi there,
I'm trying to set up an nHibernate Example as shown in the quick start guide (Link:
http://www.hibernate.org/362.html ). Unfortunately, I can't even load my Assembly using Configuration.addAssembly(). I get an exception "persistent class not found"...
I have set the buildoption for my XML-File on "Embedded Ressource".
Can anybody provide me with some ideas on what the error could be? I'm searching for a solution for some hours now and can't find anything.
Thanks a lot for your time and patience!
nHibernate version:
1.03
Mapping documents:
XML File:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB" table="users">
<id name="ID" column="ID" type="Int32">
<generator class="assigned" />
</id>
<property name="MaterialgroupID" column="MaterialgroupID" type="Int32"/>
<property name="Number" column="Number" type="String" length="255"/>
<property name="Username" column="Username" type="String" length="255"/>
<property name="Timestamp" column="Timestamp" type="DateTime"/>
</class>
</hibernate-mapping>
C#-FILE:
using System;
using System.Collections.Generic;
using System.Text;
namespace IFCC.tools.tryouts.NHT2.DB
{
public class Article
{
private int m_ID;
private int m_MaterialgroupID;
private String m_Number;
private String m_Username;
private DateTime m_Timestamp;
public Article()
{
}
public int ID
{
set { this.m_ID = value; }
get { return this.m_ID; }
}
public int MaterialgroupID
{
set { this.m_MaterialgroupID = value; }
get { return this.m_MaterialgroupID; }
}
public String Number
{
set { this.m_Number = value; }
get { return this.m_Number; }
}
public String Username
{
set { this.m_Username = value; }
get { return this.m_Username; }
}
public DateTime Timestamp
{
set { this.m_Timestamp = value; }
get { return this.m_Timestamp; }
}
}
}
Code between sessionFactory.openSession() and session.close():
- none -
Full stack trace of any exception that occurs:
18:34:01.718 [3272] ERROR NHibernate.Cfg.Configuration - Could not compile the mapping document
NHibernate.MappingException: persistent class IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB not found ---> System.TypeLoadException: Could not load type 'IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB', check that type and assembly names are correct
bei NHibernate.Util.ReflectHelper.ClassForName(String name)
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
--- Ende der internen Ausnahmestapelüberwachung ---
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
bei NHibernate.Cfg.Binder.BindClass(XmlNode node, PersistentClass model, Mappings mapping)
bei NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
bei NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)
bei NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)
Name and version of the database you are using:
MSSQL Server 9.00.1399.06
The generated SQL (show_sql=true):
- none -
Debug level Hibernate log excerpt:
18:34:01.562 [3272] INFO NHibernate.Cfg.Environment - NHibernate 1.0.2
18:34:01.578 [3272] INFO NHibernate.Cfg.Environment - Using reflection optimizer
18:34:01.578 [3272] INFO NHibernate.Cfg.Configuration - Searching for mapped documents in assembly: IFCC
18:34:01.593 [3272] INFO NHibernate.Cfg.Configuration - Found mapping documents in assembly: IFCC.tools.tryouts.NHT2.DB.Article.hbm.xml
18:34:01.656 [3272] INFO NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.MsSql2000Dialect
18:34:01.718 [3272] ERROR NHibernate.Cfg.Configuration - Could not compile the mapping document
NHibernate.MappingException: persistent class IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB not found ---> System.TypeLoadException: Could not load type 'IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB', check that type and assembly names are correct
bei NHibernate.Util.ReflectHelper.ClassForName(String name)
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
--- Ende der internen Ausnahmestapelüberwachung ---
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
bei NHibernate.Cfg.Binder.BindClass(XmlNode node, PersistentClass model, Mappings mapping)
bei NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
bei NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)
bei NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)
18:34:14.093 [3272] INFO NHibernate.Cfg.Configuration - Searching for mapped documents in assembly: IFCC
18:34:14.093 [3272] INFO NHibernate.Cfg.Configuration - Found mapping documents in assembly: IFCC.tools.tryouts.NHT2.DB.Article.hbm.xml
18:34:14.093 [3272] INFO NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.MsSql2000Dialect
18:34:14.140 [3272] ERROR NHibernate.Cfg.Configuration - Could not compile the mapping document
NHibernate.MappingException: persistent class IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB not found ---> System.TypeLoadException: Could not load type 'IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB', check that type and assembly names are correct
bei NHibernate.Util.ReflectHelper.ClassForName(String name)
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
--- Ende der internen Ausnahmestapelüberwachung ---
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
bei NHibernate.Cfg.Binder.BindClass(XmlNode node, PersistentClass model, Mappings mapping)
bei NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
bei NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)
bei NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)
18:35:13.031 [3272] INFO NHibernate.Cfg.Configuration - Searching for mapped documents in assembly: IFCC
18:35:13.031 [3272] INFO NHibernate.Cfg.Configuration - Found mapping documents in assembly: IFCC.tools.tryouts.NHT2.DB.Article.hbm.xml
18:35:13.031 [3272] INFO NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.MsSql2000Dialect
18:35:13.062 [3272] ERROR NHibernate.Cfg.Configuration - Could not compile the mapping document
NHibernate.MappingException: persistent class IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB not found ---> System.TypeLoadException: Could not load type 'IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB', check that type and assembly names are correct
bei NHibernate.Util.ReflectHelper.ClassForName(String name)
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
--- Ende der internen Ausnahmestapelüberwachung ---
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
bei NHibernate.Cfg.Binder.BindClass(XmlNode node, PersistentClass model, Mappings mapping)
bei NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
bei NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)
bei NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)
18:35:23.890 [2824] INFO NHibernate.Cfg.Environment - NHibernate 1.0.2
18:35:23.906 [2824] INFO NHibernate.Cfg.Environment - Using reflection optimizer
18:35:23.906 [2824] INFO NHibernate.Cfg.Configuration - Searching for mapped documents in assembly: IFCC
18:35:23.921 [2824] INFO NHibernate.Cfg.Configuration - Found mapping documents in assembly: IFCC.tools.tryouts.NHT2.DB.Article.hbm.xml
18:35:23.984 [2824] INFO NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.MsSql2000Dialect
18:35:24.046 [2824] ERROR NHibernate.Cfg.Configuration - Could not compile the mapping document
NHibernate.MappingException: persistent class IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB not found ---> System.TypeLoadException: Could not load type 'IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB', check that type and assembly names are correct
bei NHibernate.Util.ReflectHelper.ClassForName(String name)
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
--- Ende der internen Ausnahmestapelüberwachung ---
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
bei NHibernate.Cfg.Binder.BindClass(XmlNode node, PersistentClass model, Mappings mapping)
bei NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
bei NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)
bei NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)
18:35:25.765 [2824] INFO NHibernate.Cfg.Configuration - Searching for mapped documents in assembly: IFCC
18:35:25.765 [2824] INFO NHibernate.Cfg.Configuration - Found mapping documents in assembly: IFCC.tools.tryouts.NHT2.DB.Article.hbm.xml
18:35:25.765 [2824] INFO NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.MsSql2000Dialect
18:35:25.781 [2824] ERROR NHibernate.Cfg.Configuration - Could not compile the mapping document
NHibernate.MappingException: persistent class IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB not found ---> System.TypeLoadException: Could not load type 'IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB', check that type and assembly names are correct
bei NHibernate.Util.ReflectHelper.ClassForName(String name)
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
--- Ende der internen Ausnahmestapelüberwachung ---
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
bei NHibernate.Cfg.Binder.BindClass(XmlNode node, PersistentClass model, Mappings mapping)
bei NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
bei NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)
bei NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)
18:39:04.656 [2824] INFO NHibernate.Cfg.Configuration - Searching for mapped documents in assembly: IFCC
18:39:04.656 [2824] INFO NHibernate.Cfg.Configuration - Found mapping documents in assembly: IFCC.tools.tryouts.NHT2.DB.Article.hbm.xml
18:39:04.656 [2824] INFO NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.MsSql2000Dialect
18:39:04.671 [2824] ERROR NHibernate.Cfg.Configuration - Could not compile the mapping document
NHibernate.MappingException: persistent class IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB not found ---> System.TypeLoadException: Could not load type 'IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB', check that type and assembly names are correct
bei NHibernate.Util.ReflectHelper.ClassForName(String name)
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
--- Ende der internen Ausnahmestapelüberwachung ---
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
bei NHibernate.Cfg.Binder.BindClass(XmlNode node, PersistentClass model, Mappings mapping)
bei NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
bei NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)
bei NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)
18:39:07.265 [2824] INFO NHibernate.Cfg.Configuration - Searching for mapped documents in assembly: IFCC
18:39:07.265 [2824] INFO NHibernate.Cfg.Configuration - Found mapping documents in assembly: IFCC.tools.tryouts.NHT2.DB.Article.hbm.xml
18:39:07.265 [2824] INFO NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.MsSql2000Dialect
18:39:07.296 [2824] ERROR NHibernate.Cfg.Configuration - Could not compile the mapping document
NHibernate.MappingException: persistent class IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB not found ---> System.TypeLoadException: Could not load type 'IFCC.tools.tryouts.NHT2.DB.Article, IFCC.tools.tryouts.NHT2.DB', check that type and assembly names are correct
bei NHibernate.Util.ReflectHelper.ClassForName(String name)
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
--- Ende der internen Ausnahmestapelüberwachung ---
bei NHibernate.Cfg.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
bei NHibernate.Cfg.Binder.BindClass(XmlNode node, PersistentClass model, Mappings mapping)
bei NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
bei NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)
bei NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)