Hibernate version:101
Hi,
I am trying to configure nhibernate and log4net in the same config file.
However I am getting the following exception when I make the configure call.
System.TypeInitializationException occurred
Message="The type initializer for 'AppFramework.DataAccess.Tests.Setup' threw an exception."
Source="AppFramework.DataAccess.Tests"
TypeName="AppFramework.DataAccess.Tests.Setup"
StackTrace:
at AppFramework.DataAccess.Tests.Setup.get_DataContextFactory()
at AppFramework.DataAccess.Tests.BaseTest.get_DataContextFactory() in C:\AppFramework\DataAccess\Test\BaseTest.cs:line 48
Before I go to initialize the session factory I call
_configuration = new NHibernate.Cfg.Configuration().Configure(
Assembly.GetExecutingAssembly(),
string.Format("{0}.Hibernate.config", Assembly.GetExecutingAssembly().GetName().Name));
Here is my config file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<nhibernate>
<!-- properties -->
<add
key="hibernate.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider"
/>
<add
key="connection.driver_class"
value="Intuit.SBM.AppFramework.DataAccess.SybaseClientDriver,Intuit.SBM.AppFramework.DataAccess"
/>
<add
key="connection.isolation"
value="ReadCommitted"
/>
<add
key="show_sql"
value="true"
/>
<add
key="dialect"
value="NHibernate.Dialect.SybaseDialect"
/>
<add
key="use_outer_join"
value="true"
/>
<add
key="command_timeout"
value="444"
/>
<add
key="query.substitutions"
value="true 1, false 0, yes 1, no 0"
/>
<add
key="prepare_sql"
value="false"
/>
</nhibernate>
<!-- This section contains the log4net configuration settings -->
<log4net debug="false">
<!-- Define some output appenders -->
<appender name="trace" type="log4net.Appender.TraceAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>
<appender name="console" type="log4net.Appender.ConsoleAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>
<appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net" >
<param name="File" value="nhibernate.log" />
<param name="AppendToFile" value="false" />
<param name="RollingStyle" value="Date" />
<param name="DatePattern" value="yyyy.MM.dd" />
<param name="StaticLogFileName" value="true" />
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>
<!-- Setup the root category, add the appenders and set the default priority -->
<root>
<priority value="INFO" />
<appender-ref ref="trace" />
</root>
<logger name="NHibernate.Cache">
<level value="DEBUG" />
</logger>
<logger name="NHibernate.Impl.BatcherImpl">
<level value="WARN" />
</logger>
<logger name="NHibernate.SQL">
<level value="rollingFile" />
</logger>
</log4net>
</configuration>
I am not sure what I have wrong. I have looked through all the documentation and many of the posts and don't see anything wrong. If anyone has an idea what my problem is, I'd appreciate the help.
Thanks
Bruce
|