Task: Configure a Windows 2008 R2 server to host 64-bit SharePoint web part calling Oracle database on another machine.
aka, “Overcome the ‘ODP.NET: The provider is not compatible with the version of Oracle client’ error.”
Host: Ubuntu 10.04.1 LTS Desktop Edition
- VirtualBox 3.2.12 r68302
- Oracle 10g Express
By default, the web interface for Oracle XE is only accessible from the local host machine. Go to the Administration Settings for the site and then look for the “Manage HTTP Access” link on the right.
If you have any questions about your host supporting 64 bit guests, check this FAQ.
Guest: Windows Server 2008 R2
- SQL Server 2008
- Visual Studio 2010
- Sharepoint 2010 Enterprise Cals Trial
- Custom web parts containing connections to an oracle database, 11g R2 installed in dev mode
Configuring the server for SharePoint
- Do an update.
- Change machine identification.
- Add 2 roles: Application Server and Web Server (IIS).
- Save baseline snapshot.
- Deploy the webparts to your server, however you do that. The best way is generally via powershell script. Once you develop a generic template [link] you can use it for your projects.
Getting Oracle To Work
- Once you have deployed the web parts, if you immediately try to add them to your page, you will get errors.
- Basically, you can use this post to help you extract the needed dlls. I used the latest version of 11G R2 I could find for x64. (220.127.116.11, dated 2010-03-12) The dlls aren’t in the exact jars he describes, but they are in the same package areas, so you will find them.
- Copy the 11G R2 dlls to the bin directory of your ASP.NET applications.
- Because we are using the web parts in the default SharePoint instance, this path is C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin.
- “Required permissions cannot be acquired.” error In the IIS Manager, navigate to you site, in this case SharePoint – 80, and look for the setting “.NET Trust Levels”. Edit the application’s trust level from minimal to full and bouncing IIS.
- Failed to find or load the registered .Net Data Provider error. If that error is gone, then you may now be faced with an error about failing to find the dll. This probably has to do with our machine.config, since we DID NOT INSTALL oracle on this machine, only dropped the dlls on to it. Find the machine.config file for Framework64, located here:
Now find the following line:
<section name="system.data.oracleclient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
Replace that line with this line:
<section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
Next, find this line:
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
Replace it with this line:
<add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=188.8.131.52, Culture=neutral, PublicKeyToken=89b483f429c47342" />