-->
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.  [ 4 posts ] 
Author Message
 Post subject: Could not compile the mapping document:
PostPosted: Thu May 10, 2007 8:02 am 
Newbie

Joined: Thu May 10, 2007 6:24 am
Posts: 10
hi

i am receiveing this error
i also set Embedded Resource property of my User.hbm.xml file

Could not compile the mapping document: Nhibernate.User.hbm.xml


Loading hibernate.cfg.xml...
Loading mapping files in this executable...
16:58:05,125 ERROR ReflectHelper:0 - Could not load type Nhibernate.User, Nhiber
nate.
System.TypeLoadException: Could not load type 'Nhibernate.User' from assembly 'N
Hibernate, Version=1.2.0.3002, Culture=neutral, PublicKeyToken=aa95f207798dfdb4'
.
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Bool
ean ignoreCase)
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName n
ame, Boolean throwOnError)
16:58:05,203 ERROR Configuration:0 - Could not compile the mapping document: Nhi
bernate.User.hbm.xml
NHibernate.MappingException: Could not compile the mapping document: Nhibernate.
User.hbm.xml ---> NHibernate.MappingException: persistent class Nhibernate.User,
Nhibernate not found ---> System.TypeLoadException: Could not load type 'Nhiber
nate.User' from assembly 'NHibernate, Version=1.2.0.3002, Culture=neutral, Publi
cKeyToken=aa95f207798dfdb4'.
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Bool
ean ignoreCase)
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName n
ame, Boolean throwOnError)
at NHibernate.Util.ReflectHelper.ClassForName(String name)
at NHibernate.Cfg.HbmBinder.ClassForFullNameChecked(String fullName, String e
rrorMessage)
--- End of inner exception stack trace ---
at NHibernate.Cfg.HbmBinder.ClassForFullNameChecked(String fullName, String e
rrorMessage)
at NHibernate.Cfg.HbmBinder.BindClass(XmlNode node, PersistentClass model, Ma
ppings mappings)
at NHibernate.Cfg.HbmBinder.BindRootClass(XmlNode node, RootClass model, Mapp
ings 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 ---


Top
 Profile  
 
 Post subject: Same problem around here
PostPosted: Thu May 17, 2007 8:20 am 
Newbie

Joined: Thu May 17, 2007 8:16 am
Posts: 2
Location: Brazil
Hi there,

After fiddling a bit with nhibernate and solving bunches of *other* errors, I'm finally stuck at this new one, where it says it can't compile the mapping document (Could not compile the mapping document: BuscaCheque.Mappings.Agencia_banco.hbm.xml).

Any news on your findings? I bet that in 7 days you were able to find something out... =)

Cheers,

_________________
Marcos Accioly
Web Designer
Accioly Design and Development


Top
 Profile  
 
 Post subject: Re: Could not compile the mapping document:
PostPosted: Thu May 17, 2007 1:06 pm 
Senior
Senior

Joined: Thu Feb 09, 2006 1:30 pm
Posts: 172
mimranshafiq wrote:
hi

i am receiveing this error
i also set Embedded Resource property of my User.hbm.xml file

Could not compile the mapping document: Nhibernate.User.hbm.xml


Loading hibernate.cfg.xml...
Loading mapping files in this executable...
16:58:05,125 ERROR ReflectHelper:0 - Could not load type Nhibernate.User, Nhiber
nate.
System.TypeLoadException: Could not load type 'Nhibernate.User' from assembly 'N
Hibernate, Version=1.2.0.3002, Culture=neutral, PublicKeyToken=aa95f207798dfdb4'
.


I'm going to guess that your User class is not in the NHibernate assembly. You may have thought that the NHibate.User, <this section> referred to the namespace, but it is not. It is meant to be the assembly which contains your class definition. Most likely you set the incorrect assembly, since your user class will not be in the NHibernate assembly. Put the correct assembly name there (based on your project's configuration) and all should work fine.


Top
 Profile  
 
 Post subject: same problem for me occured
PostPosted: Fri Jul 04, 2008 6:41 am 
Newbie

Joined: Fri Jul 04, 2008 6:25 am
Posts: 1
Location: Kochin, Kerala, India
I got also same error, but I found later that it was due to the NHibernate settings defined at the config file.

I changed the config section from

<?xml version="1.0" encoding="utf-8" ?>
<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.dialect"
value="NHibernate.Dialect.MsSql2000Dialect"
/>
<add
key="hibernate.connection.driver_class"
value="NHibernate.Driver.SqlClientDriver"
/>
<add
key="hibernate.connection.connection_string"
value="qss168;Integrated Security=False; User ID=sa;Password=a-pha;initial catalog=Test_Spring"
/>
</nhibernate>
</configuration>


to the current one below
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler,NHibernate"/>
</configSections>

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="dialect">
NHibernate.Dialect.MsSql2005Dialect
</property>
<property name="connection.driver_class">
NHibernate.Driver.SqlClientDriver
</property>
<property name="connection.connection_string">
Data Source=qss168;Integrated Security=False; User ID=sa;Password=a-pha;initial catalog=Test_Spring
</property>
</session-factory>
</hibernate-configuration>


then it got worked. reason I don't know

I think the type attribute value in the section seems to be different.

I am suggesting just to check this section of yours.
I hope some one wiser than me can explain what is the real issue :)[color=orange]
[/color]

_________________
The hands that help are holier than lips that pray


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