Oracle 10g ODP.NET 10.2.x

Posts   
 
    
dstrukov
User
Posts: 10
Joined: 08-Dec-2009
# Posted on: 08-Dec-2009 16:08:08   

Hi.

I keep on getting an exception while trying to create a project using oracle 10g ODP.net driver.

LLBL Version 2.6 Final DEMO OS Vista Ultimate 64bit 10g Oracle client (ODP.NET version 2.102.2.20 )

I have tried installing 11g Client, but still no luck.

Exception i get:


Exception has been thrown by the target of an invocation.

Stack:


at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at SD.LLBLGen.Pro.ApplicationCore.DBDriverHelper.CreateDBDriverInstance(String assemblyFilename, String namespaceToUse, String className)
at bf.c()

Any suggestions?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 08-Dec-2009 18:22:02   

could you open the fuslogvw.exe application (is in the .NET SDK on your harddisk), and open the node for llblgenpro.exe and see which dll the CLR was looking for it couldn't find? (you can also see the paths there, so verify whether it indeed looked at places you expected). 11g should install a policy file

Frans Bouma | Lead developer LLBLGen Pro
dstrukov
User
Posts: 10
Joined: 08-Dec-2009
# Posted on: 09-Dec-2009 08:53:28   

Seems like it finds the driver, but still is not able to lad it for some reason. Most likely it has something to do with the fact that LLBLGen is 64bit and the Oracle.DataAccess is 32bit.

If 64 bit LLBLGen loads 32bit Oracle.DataAccess which does an invoke to my 64 bit OS ....

The log:


LOG: DisplayName = Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = LLBLGenPro.exe
Calling assembly : SD.LLBLGen.Pro.DBDrivers.OracleDBDriver10g, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6 Demo\LLBLGenPro.exe.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/SqlServerUDTAssemblies/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/SqlServerUDTAssemblies/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/Drivers/Oracle/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/Drivers/Oracle/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/Drivers/SqlServer/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/Drivers/SqlServer/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/Drivers/Firebird/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/Drivers/Firebird/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v2.6 Demo/Drivers/Oracle10g/Oracle.DataAccess.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6 Demo\Drivers\Oracle10g\Oracle.DataAccess.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 09-Dec-2009 10:28:38   

I guess the ODP.NET isn't installed correctly on your machine. Just to be sure please check the following registry path, and see if it contains any value: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ODP.NET

ref: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=14351

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 09-Dec-2009 10:50:05   

To also exclude 64/32bit, please use the attached .exe file. Please use the following steps: - place the .exe file attached to this post in the llblgen pro installation folder (so it is in the same folder as llblgenpro.exe) - copy llblgenpro.exe.config to llblgenpro_x86.exe.config - run llblgenpro_x86.exe

This will open a console and start llblgen pro normally. Please open task manager and verify that LLBLGen Pro (and the x86 variant) runs under 32bit: these processes have to have a '*' behind their name.

try again with odp.net.

If you're worried about running executables, it's a very small application which is build against x86 (so not any cpu) and simply invokes the Main method of the designer exe. Full code:


//////////////////////////////////////////////////////////////////////////////////
// 32bit enforcer for LLBLGen Pro .exe. Enforcer is necessary if user needs
// to run the .exe on 32bit under a 64bit OS.
//////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Reflection;

namespace SD.LLBLGen.Pro.x86Runner
{
    /// <summary>
    /// Simple enforcer class
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            // obtain the full path of the LLBLGenPro.exe file
            string pathFileName = Path.Combine(Application.StartupPath, "LLBLGenPro.exe");
            Console.WriteLine("Trying to load and execute: {0}", pathFileName);
            Assembly designerAssembly = Assembly.LoadFile(pathFileName);
            Type mainUIForm = designerAssembly.GetType("SD.LLBLGen.Pro.Gui.Startup");
            MethodInfo mainMethodInfo = mainUIForm.GetMethod("Main", BindingFlags.Static | BindingFlags.NonPublic);
            object[] arguments = new object[1];
            arguments[0] = args;
            mainMethodInfo.Invoke(null, arguments);
        }
    }
}

Credit: http://objectmix.com/dotnet/349806-way-force-32bit-execution-net-2-0-x64-environment.html

Attachments
Filename File size Added on Approval
LLBLGenPro_x86.exe 16,384 09-Dec-2009 10:50.52 Approved
Frans Bouma | Lead developer LLBLGen Pro
dstrukov
User
Posts: 10
Joined: 08-Dec-2009
# Posted on: 10-Dec-2009 09:45:30   

Application does not start while using the x86


Description:
  Stopped working

Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01: llblgenpro_x86.exe
  Problem Signature 02: 1.0.0.0
  Problem Signature 03: 4b1f71b7
  Problem Signature 04: LLBLGenPro_x86
  Problem Signature 05: 1.0.0.0
  Problem Signature 06: 4b1f71b7
  Problem Signature 07: 1
  Problem Signature 08: 30
  Problem Signature 09: System.NullReferenceException
  OS Version:   6.0.6001.2.1.0.256.1
  Locale ID:    2067


Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 10-Dec-2009 09:58:57   

Also please, would you check my previous post, thanx.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 10-Dec-2009 10:18:02   

dstrukov wrote:

Application does not start while using the x86


Description:
  Stopped working

Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01: llblgenpro_x86.exe
  Problem Signature 02: 1.0.0.0
  Problem Signature 03: 4b1f71b7
  Problem Signature 04: LLBLGenPro_x86
  Problem Signature 05: 1.0.0.0
  Problem Signature 06: 4b1f71b7
  Problem Signature 07: 1
  Problem Signature 08: 30
  Problem Signature 09: System.NullReferenceException
  OS Version:   6.0.6001.2.1.0.256.1
  Locale ID:    2067


You did copy llblgenpro.exe.config to llblgenpro_x86.exe.config? You also placed this .exe inside the demo installation folder? Could you start it on the command prompt and when you get the 'crashed... debug?' dialog, deny that, it should print an exception in the console.

Edit Trying the .exe out on Windows 7 64bit it indeed crashes, looking into it. I think it's the obfuscation of the .exe which comes into play...

Edit2 It was the obfuscation. Found another method to call the entry point, so it works now. Please see the new exe attached to this post.

Attachments
Filename File size Added on Approval
LLBLGenPro_x86.exe 16,384 10-Dec-2009 10:44.26 Approved
Frans Bouma | Lead developer LLBLGen Pro
dstrukov
User
Posts: 10
Joined: 08-Dec-2009
# Posted on: 10-Dec-2009 11:19:43   

I have forced the 32bit flag on LLBLGenPro.exe using .NET CorFlags /32BIT+ /Force command after that it invalidated the signature(strong name) of LLBLGenPro, but it loaded the driver.

dstrukov
User
Posts: 10
Joined: 08-Dec-2009
# Posted on: 10-Dec-2009 11:22:22   

It does work with your new version of the x86 louncher

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 10-Dec-2009 12:02:35   

So the 32bit / 64bit -ness of the process was indeed the cause. Good to know! simple_smile Thanks for testing. CorFlags could lead to an unusable .exe in our case, so keep the original .exe and the launcher.

Your own application will likely run into the same problem, so you need to compile that in 32bit or make sure the odp.net installation is done properly (as Walaa pointed out)

Frans Bouma | Lead developer LLBLGen Pro
dstrukov
User
Posts: 10
Joined: 08-Dec-2009
# Posted on: 10-Dec-2009 12:05:11   

Thanx for the support.

Ill try to reinstall everything clean (oracle client, LLBLGen) and see if it works completely with the loader.

Thanx again

dstrukov
User
Posts: 10
Joined: 08-Dec-2009
# Posted on: 10-Dec-2009 13:48:05   

Walaa wrote:

I guess the ODP.NET isn't installed correctly on your machine. Just to be sure please check the following registry path, and see if it contains any value: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ODP.NET

ref: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=14351

On 64bit machines HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ODP.NET is not present. instead it is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE\ODP.NET

both keys are present 1x and 2x

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 11-Dec-2009 10:34:41   

I think this is logical, oracle's ado.net provider is a wrapper around their client, which is 32bit it seems (at least doesn't scale up to 64bit).

There's a 64bit ODP.NET however: http://www.oracle.com/technology/software/tech/windows/odpnet/64-bit/index.html

I think it's wise to use that one on 64bit windows.

(edit) ... although the 64bit ODAC installer simply crashes here (with a java error, no heap available ... confused ) on windows 7 64bit. Could be the windows 7 install on the VM, not sure.

Frans Bouma | Lead developer LLBLGen Pro
dstrukov
User
Posts: 10
Joined: 08-Dec-2009
# Posted on: 12-Dec-2009 19:13:25   

you can use the installer from other version of ODAC that work ...just copy the setup.exe

but that does not seem to fix the problem with the driver. Ill post on Tuesday when ill be back.

dstrukov
User
Posts: 10
Joined: 08-Dec-2009
# Posted on: 16-Dec-2009 12:30:41   

I was not able to install 64 bit ODAC...

I solved my situation by generating the LLBLGen project and code on the other machine. then i still had problems connecting (already in code) to database.

So that means that the problem was either my oracle client installation or oracle client it self.

I managed to solve the connection problem in my code by using 11g Oracle Instant Client and 11g ODP.NET. It's a single package available for download from oracle.

So i dumped all the relevant dlls (ODP and Client) in my bin directory and added assembly redirect to my App.config file.


<dependentAssembly>
        <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
        <bindingRedirect oldVersion="2.102.2.20" newVersion="2.111.7.20" />
      </dependentAssembly>

After i figured that if i do the same in to llbl (i.e put the ODP and the oracle client next to it) it might also work ...

so what i did, i added the assembly redirect to both config files (normal and x86loader config), then i put the content of instant client (some dlls ) to the drivers/oracle10g dir. Lounched the llbl with a x86 louncher and it WORKED!!! 5 days well spent simple_smile

btw .... as the tnsnames.orc is not available, use a full connection string instead of the name. something like that:


(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME = MySID)))

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 16-Dec-2009 13:42:18   

glad it finally works! simple_smile

Frans Bouma | Lead developer LLBLGen Pro