NHibernate Forge
The official new home for the NHibernate for .NET community

Comments: Configure Log4Net for use with NHibernate

Wiki Page Hierarchy

Pages

Page Details

First published by:
gabriel.schenker
on 09-07-2008
Last revision by:
John Davidson
on 09-19-2011
6 people found this article useful.
Comments (3)
History (6)

Configure Log4Net for use with NHibernate

Sort by: Published Date | Most Recent | Most Useful
By: nicetoyou Posted on 11-10-2009 14:10

This article is short, but well written.

By: Arindam Posted on 04-03-2011 18:23

i am getting NHibernate configuration ProxyFactoryFactory exception , can anybody help me please ?

This is how my configuration file look like.

< configSections >

< section name="hibernate-configuration"

type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" / >

< /configSections >

< hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >

< session-factory name="EClinic" >

< property name="connection.provider" >NHibernate.Connection.DriverConnectionProvider< /property >

< property name="connection.driver_class" >NHibernate.Driver.SqlClientDriver< /property >

< property name="connection.connection_string" >Server=(arindam123);initial catalog=mydatabasename;userid=username;password=mypass;Integrated Security=SSPI; < /property >

< property name="dialect" >NHibernate.Dialect.MsSql2005Dialect< /property >

< property name="proxyfactory.factory_class" >NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle< /property >

< property name="show_sql" >true< /property >

< /session-factory >

< /hibernate-configuration >

< /configSections >

I am getting following error

The ProxyFactoryFactory was not configured.

Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers.

Example:

NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu

Example:

NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException: The ProxyFactoryFactory was not configured.

Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers.

Example:

NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu

Example:

NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle

Source Error:

Line 20: log4net.Config.XmlConfigurator.Configure();

Line 21: Configuration cfg = new Configuration();

Line 22: m_sessionFactory = cfg.BuildSessionFactory();

Line 23:

Line 24: }

By: iamaster Posted on 10-12-2011 14:08
100% of people found this useful

Log4Net tutorials are widely being spread on internet to help you get rid of such kind of problems. You can now easily consult them to get a clear  guideline. I guess it isn't so big issue but you are in need to describe a bit more. www.findkcb.com/idaho-newspapers

Powered by Community Server (Commercial Edition), by Telligent Systems