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. (11.112.1.0, 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.
Errors
- “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:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG
Now find the following line:
[code wraplines=”true”]
<section name="system.data.oracleclient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>[/code]
Replace that line with this line:
[code]<section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>[/code]Next, find this line:
[code]<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>[/code]
Replace it with this line:
[code]<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=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />[/code]
photo credit: Penningtron
Can anyone help me with my code blocks?? I’m usingĀ SyntaxHighlighter Evolved.