Home > ActiveRecord, Castle > Castle ActiveRecord – Exception : The ProxyFactoryFactory was not configured

Castle ActiveRecord – Exception : The ProxyFactoryFactory was not configured

23 January, 2009

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.
NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu
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">





        <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" />



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

Categories: ActiveRecord, Castle Tags: ,
  1. 27 January, 2009 at 10:35 am

    I don’t know much about AR config, since I only switched from RC2 to trunk today, but putting the whole database config stuff outside the facility section worked for me where putting it inside (like you did) didn’t … Thanks for posting!

  2. meetuchoudhary
    10 June, 2009 at 9:09 am

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

    from where did i get this dll

  3. 10 June, 2009 at 9:50 am

    If you have downloaded and built from the trunk you’ll find the dll in:


  4. meetuchoudhary
    10 June, 2009 at 10:24 am

    i have downloaded it but i didn’t found that at that location you said

  5. meetuchoudhary
    10 June, 2009 at 10:40 am

    can you please let mme know from where to download i am new to nhibernate. and what is this trunk

  6. 10 June, 2009 at 10:49 am

    I’m guessing you haven’t checked out the castle source and ran a build. To save you the hassle you can download the latest build from:


    The current latest release build: http://www.castleproject.org:8090/repository/download/bt6/131:id/castleproject-1.1-build_1152-net-3.5-release.zip contains a bin folder which contains a external-dependencies.zip file which contains the NHibernate.ByteCode.Castle.dll.

  7. meetuchoudhary
    10 June, 2009 at 11:09 am

    Thanks for the response.
    but before getting in depth of this I would like to clarify my problem please have a look on this conversation http://forums.asp.net/t/1432123.aspx and let me know is NHibernate is the solution to this.

  8. 10 June, 2009 at 11:29 am

    Sorry I don’t I understand the problem so can’t really comment.

  9. meetuchoudhary
    10 June, 2009 at 11:34 am

    Basically I want to create a project (whose output will be a DLL) which accepts the sql query in any kind of parameters for any database by the programer who uses that dll but the database will be opted by the end user. now the work of this dll will be it will trace the database type (SQL,Mysql,oracle etc.) opted by the end user. and then using the parametrs passed by the programmer fires the query on that type of database. and returns the resultset to the programmer for use. hope i my problem is clear to you.

  10. 10 June, 2009 at 11:50 am

    Sorry still not really clear.

    NHibernate will work with multiple database types (https://www.hibernate.org/361.html) you can query NHibernate using HQL (which is very similar syntax to SQL), NHibernate will then convert the HQL to a SQL dialect which the underlying database type understands.

    Not sure if that is any help to you, best of luck!

  11. meetuchoudhary
    10 June, 2009 at 12:02 pm

    can i have your mail id or gmailid to chat with you. if you don’t mind or i should continue here?

  12. 10 June, 2009 at 2:31 pm

    I’m not sure I can help but feel free to continue here.

  13. meetuchoudhary
    11 June, 2009 at 5:45 am

    Can you please give me the link from where i can get a working example to develop my first application using NHibernate

  14. 11 June, 2009 at 9:07 am

    There is a good series of web casts at http://www.summerofnhibernate.com/

    A good book might help http://www.manning.com/kuate/

    Any questions I would direct at http://groups.google.com/group/nhusers

    Other than that you could always Google nhibernate getting started… http://www.google.co.uk/search?q=nhibernate+getting+started

  15. meetuchoudhary
    11 June, 2009 at 9:15 am

    Thanks for the response.. i will try it…

  16. Gonzalo
    5 February, 2010 at 3:27 am

    Thanks. That worked fine for me

  17. 9 March, 2010 at 9:43 am

    Thanks – this worked for me!


  1. 4 November, 2009 at 11:12 pm
Comments are closed.
%d bloggers like this: