-->
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: Can't find entities/files
PostPosted: Wed Jan 28, 2009 12:53 pm 
Newbie

Joined: Wed Jan 28, 2009 12:39 pm
Posts: 2
I've been working to try to fix this for a couple of days. I have made a second simpler project to mitigate any assembly namespace issues I might be having, but I still get the same error. This is that simpler project. Everything is in one namespace, one project. I also created a new simple table with one column. Pretty simple. I have tested that it can at least open a session to the db and that is working. All my files are embedded.

I have tried a few options in the main config like those <mapping> tags with no avail. It just comes back and says it cannot find the .xml file

Hibernate version:
2.0.1.4000

Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="HibTest" assembly="HibTest">
<class name="Path" table="nh_test_Path" lazy="false">
<id name="Id" column="Id" type="Int32">
<generator class="native"/>
</id>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

IDictionary dict = factory.GetAllClassMetadata();
int count = dict.Count;
Path p = new Path();
session.Save(p);

Full stack trace of any exception that occurs:

NHibernate.MappingException: Unknown entity class: HibTest.Path
at NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(Type theClass)
at NHibernate.Impl.SessionImpl.GetClassPersister(Type theClass)
at NHibernate.Impl.SessionImpl.GetEntityPersister(Object obj)
at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event)
at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
at NHibernate.Impl.SessionImpl.FireSave(SaveOrUpdateEvent event)
at NHibernate.Impl.SessionImpl.Save(Object obj)
at HibTest.TestFixture.Test() in Test.cs: line 31

Name and version of the database you are using:
Sql2008

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject: FIXED
PostPosted: Wed Jan 28, 2009 5:29 pm 
Newbie

Joined: Wed Jan 28, 2009 12:39 pm
Posts: 2
In the interest of full disclosure and transparancy, I have fixed this problem. The file extension was wrong on the mapping filesl. I had *.nbm.xml instead of *.hbm.xml. I will now go spend a few hours in the sweat lodge to release this angst.


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.