Я получаю следующую ошибку при выполнении любого интеграционного теста NUnit
- Assembly setup complete -
Beginning Processing of Tests -
Test 'PXL.IntegrationTests.EventDaoTests.deleteEvent' failed: Spring.Objects.Factory.ObjectCreationException : Error creating object with name 'NHibernateSessionFactory' defined in 'assembly [PXL.Dao.NHibernate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [PXL.Dao.NHibernate.Dao.Dao.xml] line 18' : Initialization of object failed : Association references unmapped class: PXL.Domain.TBEvent
----> NHibernate.MappingException : Association references unmapped class: PXL.Domain.TBEvent
at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure)
at Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments)
at Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure)
at Spring.Objects.Factory.Support.DefaultListableObjectFactory.GetObjectsOfType(Type type, Boolean includePrototypes, Boolean includeFactoryObjects)
at Spring.Objects.Factory.ObjectFactoryUtils.ObjectsOfTypeIncludingAncestors(IListableObjectFactory factory, Type type, Boolean includePrototypes, Boolean includeFactoryObjects)
at Spring.Dao.Support.PersistenceExceptionTranslationInterceptor.DetectPersistenceExceptionTranslators(IListableObjectFactory objectFactory)
at Spring.Dao.Attributes.PersistenceExceptionTranslationPostProcessor.set_ObjectFactory(IObjectFactory value)
at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper)
at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure)
at Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments)
at Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure)
at Spring.Objects.Factory.Support.DefaultListableObjectFactory.GetObjectsOfType(Type type, Boolean includePrototypes, Boolean includeFactoryObjects)
at Spring.Context.Support.AbstractApplicationContext.RegisterObjectPostProcessors(IConfigurableListableObjectFactory objectFactory)
at Spring.Context.Support.AbstractApplicationContext.Refresh()
at Spring.Testing.NUnit.AbstractSpringContextTests.LoadContextLocations(String[] locations)
at Spring.Testing.NUnit.AbstractDependencyInjectionSpringContextTests.SetUp()
--MappingException
at NHibernate.Cfg.XmlHbmBinding.CollectionBinder.BindCollectionSecondPass(XmlNode node, Collection model, IDictionary`2 persistentClasses, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.CollectionBinder.<>c__DisplayClassd.<AddCollectionSecondPass>b__c(IDictionary`2 persistentClasses)
at NHibernate.Cfg.Configuration.SecondPassCompile()
at Spring.Data.NHibernate.LocalSessionFactoryObject.AfterPropertiesSet()
at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InvokeInitMethods(Object target, String name, IConfigurableObjectDefinition definition)
at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper)
at Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure)
Assembly TearDown
0 passed, 1 failed, 0 skipped, took 4.67 seconds (NUnit 2.5.5).
Строка кода, к которой относится ошибка, - это 1-я строка конфигурации NHibernate Dao.
<!-- NHibernate Configuration -->
<object id="NHibernateSessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate21" scope="application">
<property name="DbProvider" ref="DbProvider"/>
<property name="MappingAssemblies">
<list>
<value>PXL.Dao.NHibernate</value>
</list>
</property>
<property name="HibernateProperties">
<dictionary>
<entry key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
<entry key="dialect" value="NHibernate.Dialect.MsSql2008Dialect"/>
<entry key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
</dictionary>
</property>
<!-- provides integation with Spring's declarative transaction management features -->
<property name="ExposeTransactionAwareSessionFactory" value="true" />
</object>
отсутствует файл, который он ссылается на «Связанные ссылки на сопоставленный класс: PXL.Domain.TBEvent», и, насколько я вижу, в нем нет ничего пропущенного, в файле сопоставления нет ошибок, и для сопоставления существует файл cs.и все интерфейсы существуют, и строка в дао, которая ссылается на него, также существует.
<object id="TBEventDao" type="PXL.Dao.NHibernate.HibernateTBEventDao, PXL.Dao.NHibernate">
<property name="SessionFactory" ref="NHibernateSessionFactory"/>
</object>
Я знаю, что это что-то простое, интересно, кто-нибудь здесь может дать мне некоторое понимание.