I just downloaded and am trying to convert to NH 2.0 beta 1 (from 1.2.1). I've consulted the "breaking changes" sticky post, and do not see any help on this issue there...
my config.BuildSessionFactory() method throws a NullReferenceException somewhere deep inside NH code. I have changed nothing to the previously working NH config or mapping files. The config.Configure() step seems to be picking everything up fine from the config section in my web.config (when debugging i looked at the number of mapped clases/collections/etc., and it looks reasonable).
I've included the stack trace and my hibernate-config section. Has anyone ran across this issue so far?
Thanks!!!
-Sasha Borodin
Hibernate version: 2.0 beta 1
Mapping documents:
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">
Server=xxx;Database=xxx;User ID=xxx;Password=xxx
</property>
<property name="adonet.batch_size">10</property>
<property name="show_sql">false</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="use_outer_join">true</property>
<property name="command_timeout">444</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<mapping assembly="DFWHC.GroupOne.GoRes"/>
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
[NullReferenceException: Object reference not set to an instance of an object.]
NHibernate.Tuple.Entity.EntityMetamodel.IndicatesCollection(IType type) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Tuple\Entity\EntityMetamodel.cs:368
NHibernate.Tuple.Entity.EntityMetamodel.IndicatesCollection(IType type) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Tuple\Entity\EntityMetamodel.cs:377
NHibernate.Tuple.Entity.EntityMetamodel..ctor(PersistentClass persistentClass, ISessionFactoryImplementor sessionFactory) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Tuple\Entity\EntityMetamodel.cs:189
NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Persister\Entity\AbstractEntityPersister.cs:271
NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Persister\Entity\SingleTableEntityPersister.cs:71
NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Persister\PersisterFactory.cs:51
NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionFactoryImpl.cs:229
NHibernate.Cfg.Configuration.BuildSessionFactory() in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Cfg\Configuration.cs:988
DFWHC.GroupOne.GoRes.business.common.ContextService.StartService() in D:\Development\GroupOne\GoRes\trunk\GoRes.root\GoRes\library\business\common\ContextService.cs:39
DFWHC.GroupOne.GoRes.business.common.ContextService..ctor() in D:\Development\GroupOne\GoRes\trunk\GoRes.root\GoRes\library\business\common\ContextService.cs:20
DFWHC.GroupOne.GoRes.business.common.ContextService..cctor() in D:\Development\GroupOne\GoRes\trunk\GoRes.root\GoRes\library\business\common\ContextService.cs:16
Name and version of the database you are using:
SQL Server 2005
|