Hi Again,

This is the NullReferenceException Stack trace:

en System.Collections.Generic.List`1.Add(T item)
   en 
Castle.ActiveRecord.Framework.Config.InPlaceConfigurationSource.ConvertToConfiguration(IDictionary`2
 
properties) en 
c:\ccnet\CastleWorkDir\WorkingDirectory\ActiveRecord\Castle.ActiveRecord\Framework\Config\InPlaceConfigurationSource.cs:línea
 
373
   en 
Castle.ActiveRecord.Framework.Config.InPlaceConfigurationSource.Add(Type 
type, IDictionary`2 properties) en 
c:\ccnet\CastleWorkDir\WorkingDirectory\ActiveRecord\Castle.ActiveRecord\Framework\Config\InPlaceConfigurationSource.cs:línea
 
238
   en 
Castle.ActiveRecord.Framework.Config.XmlConfigurationSource.PopulateConfigNodes(XmlNode
 
section) en 
c:\ccnet\CastleWorkDir\WorkingDirectory\ActiveRecord\Castle.ActiveRecord\Framework\Config\XmlConfigurationSource.cs:línea
 
149
   en 
Castle.ActiveRecord.Framework.Config.XmlConfigurationSource.PopulateSource(XmlNode
 
section) en 
c:\ccnet\CastleWorkDir\WorkingDirectory\ActiveRecord\Castle.ActiveRecord\Framework\Config\XmlConfigurationSource.cs:línea
 
104
   en 
Castle.ActiveRecord.Framework.Config.XmlConfigurationSource..ctor(String 
xmlFileName) en 
c:\ccnet\CastleWorkDir\WorkingDirectory\ActiveRecord\Castle.ActiveRecord\Framework\Config\XmlConfigurationSource.cs:línea
 
44
   en ServerJobs.Program.Main(String[] args) en C:\Users\Juan 
Carlos\Documents\Visual Studio 
2005\Projects\ServerJobs\ServerJobs\Program.cs:línea 21

Thank you


Juan Carlos Seguí - CAE escribió:
> Hi all,
>
> I've an assembly for all of my models that maps to two different 
> databases using ActiveRecord. This assembly is called from a console 
> application for testing purposes. All is fine if I only use 
> ActiveRecord, but as soon as I use some data type from NHibernate 
> namespace the console application fails at the first line of code:
>
> XmlConfigurationSource config = new 
> XmlConfigurationSource("nhibernate.config");
>
> This line throws a NullReferenceException (without any additional info). 
> The model's assembly has references to both NHibernate and ActiveRecord 
> assemblies. The console application has the following nhibernate.config 
> file:
>
> <activerecord isWeb="false">
>
>   <config type="Cae.Internal.Models.AdministrationDatabase`1, 
> Cae.Internal.Models">
>     <add key="connection.driver_class" 
> value="NHibernate.Driver.NpgsqlDriver" />
>     <add key="dialect" value="NHibernate.Dialect.PostgreSQLDialect" />
>     <add key="connection.provider" 
> value="NHibernate.Connection.DriverConnectionProvider" />
>     <add key="connection.connection_string" 
> value="Server=localhost;Database=test;User 
> ID=test;Password=test;Encoding=SQL_ASCII" />
>   </config>
>  
>   <config type="Cae.Internal.Models.InvoicingDatabase`1, 
> Cae.Internal.Models">
>     <add key="connection.driver_class" 
> value="NHibernate.Driver.MySqlDataDriver" />
>     <add key="dialect" value="NHibernate.Dialect.MySQLDialect" />
>     <add key="connection.provider" 
> value="NHibernate.Connection.DriverConnectionProvider" />
>     <add key="connection.connection_string" value="Data 
> Source=localhost;Database=test;User ID=test;Password=test" />
>   </config>
>
> </activerecord>
>
> If I don't use any data types from NHibernate namespace all is fine, but 
> I need to use DetachedCriteria :(
>
> In the model assembly I'm using ActiveRecordBase<T> as the base class 
> for my different abstract classes to use multiple databases, ie:
>
> [ActiveRecord]
> public abstract class AdministrationDatabase<T> : ActiveRecordBase<T>
> {
> }
>
> Does somebody have an idea of where is the problem?
>
> Thank you
>
> >
>
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to