dll相關(guān)
dll版本信息
NHibernate相關(guān)的用3.1.0.4000版本
Castle.ActiveRecord相關(guān)用3.0.0.0版本
Castle.Windsor相關(guān)用2.5.2.0版本
關(guān)于合并dll
Castle.Core.dll(2.5.2.0)包含Castle.DynamicProxy.dll洼冻、Castle.DynamicProxy2.dll(根據(jù)官方說明在版本2.5之后原先獨立的castle.dynamicproxy.dll)
Castle.Windsor.dll(2.5.2.0)包含Castle.MicroKernel.dll
需要更改的using
using NHibernate.Expression;換為using NHibernate.Criterion;
錯誤處理
A00
錯誤:初始化Castle.ActiveRecord的時候“Castle.ActiveRecord.Framework.ActiveRecordException”
處理:可能是NHibernate版本的問題畜份,如果在配置文件可以嘗試如下更改
<add key="hibernate.connection.connection_string" value="xxx" /><!--,NHibernate2.0以后淘正,已經(jīng)簡化了-->
<add key="connection.connection_string" value="xxx" /><!--去掉'hibernate'-->
A01
錯誤:提示“XXXXXXXXXXXXXXXXXXXX”的類型初始值設(shè)定項引發(fā)異常。(建立容器類)
處理:考慮版本兼容問題臼闻,嘗試換Castle.Windsor/Castle.MicroKernel dll版本
A02
錯誤:Unable to load type ' NHibernate.Bytecode.DefaultProxyFactoryFactory,NHibernate.ByteCode.Castle' during configuration of proxy factory class. Possible causes are: - The NHibernate.Bytecode provider assembly was not deployed. - The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed. Solution: Confirm that your deployment folder contains one of the following assemblies: NHibernate.ByteCode.LinFu.dll NHibernate.ByteCode.Castle.dll
處理:加NHibernate.ByteCode.LinFu.dll鸿吆、NHibernate.ByteCode.Castle.dll,加<add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" />
web.config
<?xml version="1.0"?>
<configuration>
<activerecord>
<config>
<add key="connection.driver_class" value="NHibernate.Driver.OracleClientDriver" />
<add key="connection.isolation" value="ReadCommitted" />
<add key="dialect" value="NHibernate.Dialect.Oracle9iDialect" />
<add key="connection.connection_string" value="data source=localhost:6697/orcl;user=C##CS_DB;password=123456;" />
<add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" />
</config>
</activerecord>
</configuration>
A03
錯誤:
ERROR - Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class.
Possible causes are:
- The NHibernate.Bytecode provider assembly was not deployed.
- The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed.
Solution:
Confirm that your deployment folder contains one of the following assemblies:
NHibernate.ByteCode.LinFu.dll
NHibernate.ByteCode.Castle.dll
Path And Query: /handler/SystemHandler.ashx
Request Type: POST
Http Referrer: /
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
IP Address: ::1
NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class.
Possible causes are:
- The NHibernate.Bytecode provider assembly was not deployed.
- The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed.
Solution:
Confirm that your deployment folder contains one of the following assemblies:
NHibernate.ByteCode.LinFu.dll
NHibernate.ByteCode.Castle.dll --->
System.IO.FileLoadException: 未能加載文件或程序集“NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=null”或它的某一個依賴項述呐。找到的程序集清單定義與程序集引用不匹配惩淳。 (異常來自 HRESULT:0x80131040)
處理:考慮引用版本是不是你下的那個版本,可以嘗試刪掉NHibernate相關(guān)引用再重新應(yīng)用(ps:我是因為下的NHibernate-3.1.0.GA-src自己編譯的dll乓搬,過了一天以后開始報錯思犁,換成NHibernate-3.1.0.GA-bin里面的dll后就沒得問題了)
A04
錯誤:“((NHibernate.Impl.SessionImpl)session).Connection”引發(fā)了類型“System.Data.OracleClient.OracleException”的異常
詳細描述:我有很多個表,id都是用的獲取序列號进肯,就其中一個表調(diào)用下面這個代碼時報上面那個錯誤(session的Connection獲取不了)激蹲,其它時候調(diào)用都沒問題。
處理:尚未解決
所用dll文件下載
上述dll下載于:
1.https://sourceforge.net/projects/castleproject/files/
2.https://master.dl.sourceforge.net/project/nhibernate/NHibernate/3.1.0.GA/NHibernate-3.1.0.GA-bin.zip
3.http://logging.apache.org/log4net/download_log4net.cgi