just in ram

A list of stuff I should remember but never do

Archive for the ‘Castle’ tag

Castle ActiveRecord – Exception : The ProxyFactoryFactory was not configured

with 18 comments

I’ve just updated to the latest version of the Castle stack and got hit with this exception:

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

Turns out the NHibernate config has changed and as the exception says you must now specify a factory class.

To fix the exception add a new line to your active record facility config:

<facility id="activerecord.facility" isweb="true" type="Castle.Facilities.ActiveRecordIntegration.ActiveRecordFacility, Castle.Facilities.ActiveRecordIntegration">

    <assemblies>

        <item>Nu.Core</item>

    </assemblies>

    <config>

        <add value="false" key="cache.use_query_cache" />

        <add value="ReadCommitted" key="connection.isolation" />

        <add value="false" key="show_sql" />

        <add value="NHibernate.Dialect.SQLiteDialect" key="dialect" />

        <add value="NHibernate.Driver.SQLite20Driver" key="connection.driver_class" />

        <add value="true=1;false=0" key="query.substitutions" />

        <add value="#{ConnectionString}" key="connection.connection_string" />

        <add value="NHibernate.Connection.DriverConnectionProvider" key="connection.provider" />

        <add value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" key="proxyfactory.factory_class" />

    </config>

</facility>

Then add a reference in your project to NHibernate.ByteCode.Castle.dll.

Written by Justin Ramel

January 23rd, 2009 at 4:38 pm

Posted in ActiveRecord, Castle

Tagged with ,

Castle + Using the Trunk + My registry entries

without comments

When I build from the trunk I usually follow the instructions found here:

http://using.castleproject.org/display/CASTLE/Using+the+Trunk

My source location is slightly different from the instructions so I have to hand edit the registry entries listed at the end of the page. So to save me doing that again here they are:

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Castle] "vs8templatelocation"="C:\\source\\Castle\\Tools\\VSNetWizards\\CastleTemplates\\VS8" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\castle] @="C:\\source\\Castle\\build\\net-2.0\\debug"

Written by Justin Ramel

June 18th, 2007 at 5:03 pm

Posted in Castle

Tagged with