3

I am developing custom geoprocessing tool (class-library project) on ArcGIS 10.2. This project uses Oracle.DatAccess from ODP.NET 1.0 . This is a simple tool which queries - oracle 10g database and returns a distinct records from a specific table.

This tool is working fine from tool box but when this tool is published in REST, it throws below error:

Error:The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception

ArcGIS server 10.2, Visual Studio 2012.

Server: Windows 2012 -6bit Operating system

Oracle client : installed both oracle 32 and oracle 64 bit (C:\oracle\product\10.2.0\Client_32,C:\oracle\product\10.2.0\Client_64)

PATH: c:\oracle\product\10.2.0\client_64\bin;c:\oracle\product\10.2.0\client_32\bin;

Any pointer on this issue?

To begin with, this custom GP tool project was working in ArcGIS 10.0 for last 2 years successfully. As part of technology migration activity, I am upgrading this project to 10.2. As mentioned, am using Windows 2012 server (64 bit OS) where ArcGIS Desktop and ArcGIS server 10.2 has been installed in same box. Oracle client 32, 64 bit has been installed. Path is set as above.

  • "Error:The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception" -- was that it, no further message? – Russell at ISC Apr 28 '14 at 18:31
  • Examine the exception's InnerException property, which should provide further details as to what went wrong. – Petr Krebs Apr 28 '14 at 19:00
  • @RussellatISC, Petr Krebs. - There is no inner exception on this. I have checked in ArcGIS Server logs, Fiddler, event viewer. I could not get a inner exception/stack trace. – iamlaksh1 Apr 29 '14 at 17:59
  • Gotcha. Have you tried my recommendation below? 32/64 bit mismatch in a DLL or one of its dependencies is the most common cause for this sort of error. Of course if it's a dependency that's harder to track. – Russell at ISC Apr 29 '14 at 18:06
  • @RussellatISC - I did not understand your solution. As said, I am not seeing any ArcGIS pools in IIS. – iamlaksh1 Apr 29 '14 at 18:20
1

I'd start by verifying that your website is running as 64-bit, i.e. "Enable 32-bit applications" is set False for the app pool your site runs under.

Assuming that, make sure there's no Oracle.DataAccess DLL in the website bin folder or if there is that it is the 64 bit version. If it's not there try dropping the 64 bit version into there.

  • Thanks. I have published this custom GP tool as GP service which is accessed via REST end point. I dont see any ArcGIS app pools in IIS. Note: I am using ArcGIS server 10.2 and Windows 2012 server (64bit). Can you throw some light? – iamlaksh1 Apr 29 '14 at 18:04
  • My knowledge is IIS/websites/Oracle, not ESRI per se... that said, if it's accessed via REST there should be a "web application" for it in IIS, probably under "Default Web Site" and you can see what application pool it is using under "Advanced Settings". – Russell at ISC Apr 30 '14 at 12:57
0

Is there an "inner" exception thrown as well? Check to see if you have 2 references to 2 different versions of the same DLL installed and remove one of them if you do.

You could also remove and reinstall the Oracle client software for a clean setup.

  • As said there is no inner exception, I dont have two version of same dll. Yes, I can remove oracle client, but still waiting for ESRI analyst to help me out. I don't want to change my configuration till they come back. – iamlaksh1 May 5 '14 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.