Answered by:
Biztalk Adapter pack Oracle, System.BadImageFormatException

Question
-
Hi
I have BizTalk 2013 R2 install on Win2012 with adapter pack which ships with BizTalk installation, I install Oracle ODAC 12C both 32 and 64 bit version, from Visual studio using "Consume Adapter Service" tool I can access oracle database and generate schemas, but my biztalk application keep throwing this error:
The adapter failed to transmit message going to send port "UpdateDeliverable" with URL "oracledb://srsprod-db2.bcu.ac.uk:1521/srsrep1/DEDICATED". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at Oracle.DataAccess.Client.OpsInit.CheckVersionCompatibility(String version)
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
--- End of inner exception stack trace ---
at Oracle.DataAccess.Client.OracleConnection..ctor()
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)".any help would be much appreciated.
Thanks
Friday, June 12, 2015 1:27 PM
Answers
-
Thanks for the reply, I un-install both 32 and 64 bit oracle client, and reinstall only 32 bit back, my application started working, but VS could not connect to Oracle, I created a environment variable for ORACLE_HOME and now both VS and BizTalk working.
Thanks
- Marked as answer by Angie Xu Friday, June 19, 2015 2:33 AM
Monday, June 15, 2015 2:59 PM
All replies
-
Go the Visual studio project 'properties', to the 'build' tab and make sure that you selected 'Any CPU' for the 'Platform target' variableFriday, June 12, 2015 3:26 PM
-
We have found that one of the causes of the "System.BadImageFormatException" exception results from the following set of circumstances:
1) 32-bit ODP.NET installed on 64-bit o/s
2) .NET application compiled with either "Any CPU" or "x64" set for the "Platform target"
3) The application is then deployed to the 64-bit host with the 32-bit ODP.NET installed
4) The application executes as a 64-bit application but tries to load the 32-bit ODP.NET, thus the exceptionThanks
Abhishek
Monday, June 15, 2015 6:28 AM -
Thanks for the reply, I un-install both 32 and 64 bit oracle client, and reinstall only 32 bit back, my application started working, but VS could not connect to Oracle, I created a environment variable for ORACLE_HOME and now both VS and BizTalk working.
Thanks
- Marked as answer by Angie Xu Friday, June 19, 2015 2:33 AM
Monday, June 15, 2015 2:59 PM