【茶包射手專欄】ODP.NET烏龍事件
| | 0 | | ![]() |
還原了一個VM,要新裝測試網站,執行用到ODP.NET的ASPX時遇到此一錯誤:
[NullReferenceException: Object reference not set to an instance of an object.] Oracle.DataAccess.Client.OracleException.get_Message() +33 System.Web.UnhandledErrorFormatter.get_ColoredSquare2Content() +495 System.Web.UnhandledErrorFormatter.PrepareFormatter() +45 System.Web.ErrorFormatter.GetHtmlErrorMessage(Boolean dontShowSensitiveInfo) +56 System.Web.HttpResponse.WriteErrorMessage(Exception e, Boolean dontShowSensitiveErrors) +590 System.Web.HttpResponse.ReportRuntimeError(Exception e, Boolean canThrow, Boolean localExecute) +225 System.Web.HttpRuntime.FinishRequest(HttpWorkerRequest wr, HttpContext context, Exception e) +383
Google的結果多指向ODP.NET沒安裝,但檢視Oracle Home bin目錄下已有Oracle.DataAccess.dll,ODP.NET 9207安裝程式也顯示已安裝。不放心,重裝一次ODP.NET 9207,錯誤依舊。
最後同事終於找到問題,原因挺有趣的(雖然追查的過程很痛苦)。
原來是裝機過程依循SOP,執行了一些預先預先寫好的Script,其中有一個reg檔用來設定NLS_LANG等設定,但壞在它也指定了ORACLE_HOME,標準主機Oracle Client都會裝在D:\,而這台測試VM則只有C:\,因此ora92是裝在C:,造成了路徑錯指。
修正後再IISRESET,問題排除。
Comments
Be the first to post a comment