Hi Markus,
Each ASP.NET application has one Global.asax (Mandatory) file.
In which application_start, session_start, session_end,application_end
methods are existed.
Application_Start method executes first when application first time
run. (Only one time execute)
So I have initialized whole assembly (which contains all classes which
inherits ActiveRecord class).
====================================================
Now about problem
Problem is resolved.
I have removed following section from my current application. This
section is inherited by asp.net from root application web.config which
I described earlier. So Castle might not find which
“hibernate.connection.provider” use while initializing the
ActiveRecord. Even following section is under < activeRecord><config>
section.
====================================================
<add key="hibernate.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider"/>
<add key="hibernate.dialect"
value="NHibernate.Dialect.OracleDialect"/>
<add key="hibernate.connection.driver_class"
value="NHibernate.Driver.OracleClientDriver"></add>
<add
key="hibernate.connection.connection_string" value="Data
Source=ora11g;User ID=test123;Password=test123;"/>
=====================================================
Thanks,
Bhumip
On May 27, 6:43 pm, Markus Zywitza <[email protected]> wrote:
> I don't know ASP.NET to well: Is Global.asax executed for an
> application in a virtual directory? Please do some logging there to
> verify that ActiveRecord is really initialized.
>
> -Markus
>
> 2009/5/27 Bhumip <[email protected]>:
>
>
>
> > I am trying to deploy my application under sub domain (virtual
> > directory) of my root application.
>
> > 1) Root application there is following nhibernate section in
> > web.config
>
> > <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.OracleDialect"/
>
> > <add key="hibernate.connection.driver_class"
> > value="NHibernate.Driver.OracleDataClientDriver"></add>
>
> > <add key="hibernate.connection.connection_string" value="Data
> > Source=ora11g;User ID=test123;Password=test123;"/>
>
> > </nhibernate>
>
> > 2) My current application which I want to configer under root
> > application have following ActiveWriter Section
>
> > <configSections>
> > <section name="activeRecord"
> > type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler,Castle.ActiveRecord"/
>
> > </configSections>
>
> > <activeRecord isWeb="true">
> > <config>
>
> > <add key="hibernate.connection.provider"
> > value="NHibernate.Connection.DriverConnectionProvider"/>
> > <add key="hibernate.dialect"
> > value="NHibernate.Dialect.OracleDialect"/>
> > <add key="hibernate.connection.driver_class"
> > value="NHibernate.Driver.OracleClientDriver"></add>
> > <add key="hibernate.connection.connection_string"
> > value="Data
> > Source=ora11g;User ID=test123;Password=test123;"/>
>
> > </config>
> > </activeRecord>
>
> > I do not know exactly but because of web.confing inheritance of root
> > application may create this kind of error.
>
> > ??????????????????
>
> > On May 27, 1:54 pm, Bhumip <[email protected]> wrote:
> >> Hi Markus,
>
> >> "ManilaPayroll.BAL.dll" business access layer where i put all my
> >> business logic of payroll system.
>
> >> Thanks,
>
> >> Bhumip
>
> >> On May 27, 12:17 pm, Markus Zywitza <[email protected]> wrote:
>
> >> > And what about
>
> >> > ManilaPayroll.BAL.dll
>
> >> > which is the assembly you are trying to load for initialization?
>
> >> > 2009/5/26 Bhumip <[email protected]>:
>
> >> > > Hi John,
>
> >> > > Following is the list of dlls in my bin folder.
>
> >> > > Castle.ActiveRecord.dll
>
> >> > > Castle.Components.Validator.dll
>
> >> > > Castle.Core.dll
>
> >> > > Castle.DynamicProxy.dll
>
> >> > > Iesi.Collections.dll
>
> >> > > log4net.dll
>
> >> > > NHibernate.dll
>
> >> > > Also Following is the ActiveRecordSection in web.config file
>
> >> > > -----------------------------------------------------------
> >> > > <configSections>
> >> > > <section name="activeRecord"
> >> > > type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler,Castle.ActiveRecord"/
>
> >> > > </configSections>
> >> > > <activeRecord isWeb="true">
> >> > > <config>
> >> > > <add key="hibernate.connection.provider"
> >> > > value="NHibernate.Connection.DriverConnectionProvider"/>
> >> > > <add key="hibernate.dialect"
> >> > > value="NHibernate.Dialect.OracleDialect"/>
> >> > > <add key="hibernate.connection.driver_class"
> >> > > value="NHibernate.Driver.OracleClientDriver"></add>
> >> > > <!--<add key="hibernate.connection.connection_string"
> >> > > value="Data Source=ora11g;User ID=hrd1;Password=test123;"/>-->
> >> > > <add key="hibernate.connection.connection_string" value="Data
> >> > > Source=ora11g;User ID=phrd;Password=testtest;"/>
> >> > > </config>
>
> >> > > </activeRecord>
> >> > > <connectionStrings>
>
> >> > > --------------------------------------------------------------------------------------------
>
> >> > > On May 26, 4:31 pm, John Simons <[email protected]> wrote:
> >> > >> Are you sure you've deployed all the assemblies including dependency
> >> > >> assemblies?
>
> >> > >> John
>
> >> > >> On May 26, 7:58 pm, Bhumip <[email protected]> wrote:
>
> >> > >> > Hi John,
>
> >> > >> > i have initialized in Global.asax and following is the code.
>
> >> > >> > void Application_Start(object sender, EventArgs e)
> >> > >> > {
> >> > >> > Castle.ActiveRecord.Framework.IConfigurationSource source =
> >> > >> > System.Configuration.ConfigurationManager.GetSection("activeRecord")
> >> > >> > as Castle.ActiveRecord.Framework.IConfigurationSource;
> >> > >> > System.Reflection.Assembly modelAssembly =
> >> > >> > System.Reflection.Assembly.Load("ManilaPayroll.BAL");
> >> > >> > Castle.ActiveRecord.ActiveRecordStarter.Initialize
> >> > >> > (modelAssembly, source);
>
> >> > >> > }
>
> >> > >> > Some how it is work on my local machine it is not working on my
> >> > >> > production machine where we have IIS 6.0 as web server.
>
> >> > >> > Regards,
>
> >> > >> > Bhumip
>
> >> > >> > On May 26, 2:20 pm, John Simons <[email protected]> wrote:
>
> >> > >> > > Did u call ActiveRecordStarter.Initialize() as the first thing?
>
> >> > >> > > ________________________________
> >> > >> > > From: Bhumip <[email protected]>
> >> > >> > > To: Castle Project Users <[email protected]>
> >> > >> > > Sent: Tuesday, 26 May, 2009 2:57:38 PM
> >> > >> > > Subject: You have accessed an ActiveRecord class that wasn't
> >> > >> > > properly initialized.
>
> >> > >> > > I am working VS 2005 and .NET 2.0 and database Oracle 11g
>
> >> > >> > > Active Record is working on my local system when i deployed the
> >> > >> > > system
> >> > >> > > on Server.
>
> >> > >> > > I have added [ActiveRecord] on top of the class but still error is
> >> > >> > > coming.
>
> >> > >> > > Following ERROR is coming
>
> >> > >> > > You have accessed an ActiveRecord class that wasn't properly
> >> > >> > > initialized. The only explanation is that the call to
> >> > >> > > ActiveRecordStarter.Initialize() didn't include
>
> >> > >> > > Please help me out i have deadline on Friday. My work is done but
> >> > >> > > i
> >> > >> > > can not deploy on the Production server because of following
> >> > >> > > ERROR.
>
> >> > >> > > Need a Holiday? Win a $10,000 Holiday of your choice. Enter
> >> > >> > > now.http://us.lrd.yahoo.com/_ylc=X3oDMTJxN2x2ZmNpBF9zAzIwMjM2MTY2MTMEdG1f...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---