Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
535 views
in Technique[技术] by (71.8m points)

c# - OracleException (0x80004005) When Connecting to Oracle Database

I've developed a simple C#, .net 4.0 website which I'd like to deploy onto an IIS test server. I am using the Oracle.DataAccess assembly to connect to an Oracle database, and I've added that DLL (and a hell of a lot of other related DLL's, just for good measure and in a shotfun attempt to try and solve this problem), to the bin folder of my website. it works fine on my development machine (obviously; worked fine before copying all of those DLLs), but not my test server. On the test server I receive the following exception:

[OracleException (0x80004005)]
   Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck) +1468
   Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) +24
   Oracle.DataAccess.Client.OracleConnection.Open() +4391
   MappingQueries.connect() +173
   scripts_list_mappings.Page_Load(Object sender, EventArgs e) +17
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

No error message, no specifics. Is there some way I can get more information, or could there be some solution to this problem? I'm at a bit of a loose end here, so any useful information would be greatly appreciated.

The Solution (sort of)

Okay, I've fixed this in a roundabout way, and I'd like to leave a few suggestions for whoever comes up against a similar problem.

First things first: it helped me to have a simple test application which I could use to determine if the problem was IIS. I used a simple C# application that connected to my Oracle database. My aim was to get that to work properly, which I did so by installing the Oracle instant client.

Next step: run the application using a privileged account. I used my own administrative account, which I had run my test application with.

Finally, to determine whether this was a 32/64 bit problem, I checked the registry to determine where my Oracle variables were: HKLM/Software/Oracle, or HKLM/Software/WOW6432/Oracle. I also tried running SQLPLUS from the command line, and checking weather the process displayed as *32 (to indicate a 32 bit application), in the Process Manager.

I think that's about it. Clearly there's no 'one size fits all, solution to this problem, but hopefully anyone who comes across this question will find some assistance in the details I've provided, and the helpful comments below.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

While you did not get a specific error message, there's a good chance that there is an incompatibility with ODP.Net (version numbers, 32bit vs 64bit DLLs) installed locally vs. on your test server.

This answer has several options which might help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...