0

I'm working on a clean BizTalk 2020 install (with Cumulative Update 4). I installed the Oracle Client 19c (both 32-bit and 64-bit). According to a white paper from Sandro Pereira this is the highest supported version.

I've read this StackOverflow, but not sure I understand the answer. There also a comment there about install Oracle 12c client first.

I've installed BizTalk 2020 and testing various features we use. When I ran an orchestration that retrieves data from Oracle, I get the error below:

A message sent to adapter "WCF-Custom" on send port "TestProject.EBSSendReceivePort_WCF-Oracle" with URI "oracledb://ServerABC/" is suspended. 
 Error details: System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.
File name: 'Oracle.DataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342'
   at Microsoft.Adapters.OracleDB.OracleDBBinding.Initialize()
   at Microsoft.Adapters.OracleDB.OracleDBBinding.CreateBindingElements()
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.InitializeValues(IBaseMessage message)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2..ctor(IBaseMessage message, WcfTransmitter`2 transmitter)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfTransmitter`2.GetClientFromCache(String spid, IBaseMessage message)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfAsyncBatch`2.BatchWorker(List`1 messages)

I followed these steps - copy of HAJJAJ' answer from here:

Register the Oracle.DataAccess.dll assembly You must register the Oracle.DataAccess.dll assembly to the Global Assembly Cache (GAC) for .NET version 2 and version 4:

Open a command prompt as an Administrator.

Navigate to %ORACLE_CLIENT_HOME%\ODP.NET\bin\2.x.

Execute the following command:: oraprovcfg.exe/action:gac/providerpath:Oracle.DataAccess.dll

Navigate to %ORACLE_CLIENT_HOME%\ODP.NET\bin\4.x.

Execute the following command: oraprovcfg.exe/action:gac/providerpath:Oracle.DataAccess.dll

After that I see these two files: c:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess\v4.0_4.122.19.1__89b483f429c47342\oracle.dataaccess.dll and c:\Windows\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess\v4.0_4.122.19.1__89b483f429c47342\oracle.dataaccess.dll

(and nothing in GAC_MSIL)

I have tried the following redirect. Since the error refers to 4.122.18.3, I tried mapping it to the numbers from the above GAC (4.122.19.1). I noticed that the last two digits, 18.3 and 19.1 are versions of the Oracle Client (18c and 19a? respectively). I'm not sure why it's 19.1 and not 19.3.

From Sandro Pereira's doc

When I ran the setup, it clearly said 19c: enter image description here

In Sandro Pereira's white paper, he demonstrates with 12c, but suggests that 18c and 19c are valid.

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" />
      <bindingRedirect oldVersion="4.122.18.3" newVersion="4.122.19.1" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

I've been trying many things last 2-3 days, and I appreciate any ideas.

Update 1: Just after posting, I noticed something wrong with my redirect, and changed 2.122 to 4.122.

Current running SendPort in 32 bit host, then I will try with 64-bit after I get this working.

By the way, with the redirect the error is slightly different:

A message sent to adapter "WCF-Custom" on send port "TestProject.EBSSendReceivePort_WCF-Oracle" with URI "oracledb://EBZSND2/" is suspended. 
 Error details: System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for oracle.dataaccess.client: Could not load file or assembly 'System.Data, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified. (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config line 14) ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Data, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

UPDATE 1

I wrote a C# console program in VS2019 (.NET Framework 4.7.2).

   OracleConnection conn = new OracleConnection(oraDbStr);

ConfigurationErrorsException: An error occurred creating the configuration section handler for oracle.dataaccess.client: Could not load file or assembly 'System.Data, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified. (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config line 15)

I had the "prefer 32 bit" build option not selected, to force 64-bit.

This is that part of my machine.config where the XML comment is line 14, and the 4.122.19.1 is line 15. I have tried both the 4.122.18.3 and the 4.122.19.1. As mentioned above, it is 4.122.19.1 that is in this directory: 'c:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess\v4.0_4.122.19.1__89b483f429c47342\oracle.dataaccess.dll' and note - this is the file that I did the "Add reference" to in the C# program.

<configuration>
    <configSections>
        <!-- <section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342" />--> 
        <section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" /> 
        <section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="false" requirePermission="false" />
NealWalters
  • 17,197
  • 42
  • 141
  • 251
  • How did you install 32-bit and 64-bit client? Have a look at https://stackoverflow.com/questions/24104210/badimageformatexception-this-will-occur-when-running-in-64-bit-mode-with-the-32#24120100 – Wernfried Domscheit Apr 14 '23 at 20:36
  • @WernfriedDomscheit I ran the setup.exe for each of those clients. I'm running in 32-bit host now. – NealWalters Apr 14 '23 at 21:07
  • Without the instruction I gave above, the most recent installation wins, I.e. if you install first the 32-bit version and then the 64-bit version, then the 32-bit client is not available anymore (unless you do some changes on `PATH` variable) – Wernfried Domscheit Apr 15 '23 at 05:58
  • Have you tried to use the fusion log viewer to see what assembly is the real load failure cause? It might be a dependency that is causing the issue? Maybe write a console app that only does an Assembly.Load on the Oracle, then check the Fusion log. Might give more insight. – Marvin Smit Apr 15 '23 at 07:45
  • @MarvinSmit - I did this, and it loads in the console program, but same error in BizTalk: Assembly.Load("Oracle.DataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342") where the 4.122.18.3 is testing the redirect in my machine.config. – NealWalters Apr 17 '23 at 19:23
  • Grasping at straws here. Could it be security related? Did you run the console app under the same account as the host selected for the port? And then something which might seem unrelated but i ran into recently with cloned VM's, user-accounts, etc. Is there any mention of "errors" about performance counters in the eventlog? – Marvin Smit Apr 17 '23 at 20:02
  • Another straw. Is this a "writeLog" mistake or is there an value filled incorrectly somewhere? File name: 'Oracle.DataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342' That's no file name. That's a FQN. – Marvin Smit Apr 18 '23 at 15:55
  • @MarvinSmit - See "Update 1" in my question, I tested it in C# in Visual Studio and got same error. – NealWalters Apr 19 '23 at 21:49
  • What is installed (GAC, - .Net 4 - Explicit 64bit) in: C:\Windows\Microsoft.NET\assembly\GAC_64\System.Data ? Does the version number in the directory shown match the machine.config line, in both version and public key? Do you have any redirects in BTSNTSvc(64).exe.config? – Marvin Smit Apr 20 '23 at 16:17
  • ps, as of UPDATE 1 in your post, the Oracle.DataAccess seems to be loading into your appdomain alright, but in it's turn seems to reference a specific version of System.Data which might not be available on your machine. – Marvin Smit Apr 20 '23 at 16:31
  • I had a similar issue in BizTalk 2016 when installing CU9. It changed the machine.config on one node, but not the other. I rolled back the change to the machine.config and it was fine again. – Dijkgraaf May 08 '23 at 02:52

1 Answers1

0

I don't understand why, but commenting out the offending line in the machine.config (in c:\windows\Microsoft.NET\Framework\v4.0.30319\Config and also Framework640 seems to have solved the issue. I think running the Oracle setup or the Oracle oraprovcfg.exe put them there to begin with. I still have the redirect in the machine.config, maybe I will try commenting that out later.

<configuration>
    <configSections>
        <!-- <section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342" />--> 
        <!-- <section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />  -->
        <section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="false" requirePermission="false" />
        <section name="connectionStrings" type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" requirePermission="false" />
NealWalters
  • 17,197
  • 42
  • 141
  • 251