Can not obtain Oracle client information from registry.

Can not obtain Oracle client information from registry.

Postby mrs5088 » Wed 08 Jul 2009 16:36

Hi,
I'm getting the following error when I'm attempting to connect to the oracle datbaase from my ASP.NET Dynamic Data Entities Website. We have Oracle instant client installed on the target PC. I'm able to connect to the database using the oracle instant client but not with the dotConnect for Oracle. I've also pasted the connection string that I'm using in my web.config to connect to the database. Please help. I purchased this product and I need to deploy my app to the client's PC.

Exception Details: System.InvalidOperationException: Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server.

Connection String in Web.Config



Here is the entire stack trace of the error.

Stack Trace:

[InvalidOperationException: Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server.]
Devart.Data.Oracle.OracleHomeCollection.a() +1874
Devart.Data.Oracle.OracleInternalConnection..ctor(y connectionOptions, OracleInternalConnection proxyConnection) +382
Devart.Data.Oracle.by.a(i A_0, Object A_1, DbConnectionBase A_2) +116
Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, i A_1) +43
Devart.Common.DbConnectionPoolGroup.c(DbConnectionPool A_0) +18
Devart.Common.DbConnectionPool.a() +44
Devart.Common.DbConnectionPool.GetObject() +411
Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0) +77
Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection) +144
Devart.Common.DbConnectionBase.Open() +30
Devart.Data.Oracle.OracleConnection.Open() +267
Devart.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) +314

[ProviderException: An exception occurred. Please contact your administrator.]
Devart.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) +1807
System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +318
System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +102
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +418
System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +161
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
mrs5088
 
Posts: 7
Joined: Fri 20 Feb 2009 17:12

Postby Shalex » Thu 09 Jul 2009 10:36

These are the possible reasons of the problem:
  • Oracle client is not installed on the deployment server.
  • Your web application has the limited trust level. Please check the tag in the web.config file of your project. The web.config file of your application overrides the according section of \WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config if there is no allowOverride="false" setting.
  • There is no oci.dll available in the folder of Oracle client installation. It also can be caused by some Windows error, if the lenth of the PATH variable is more than 800 symbols. You can check the workability of the following code in your application. This piece of code does the same as dotConnect for Oracle:
    Code: Select all
    string path = Environment.GetEnvironmentVariable("PATH");
    string[] envPaths = path.Split(';');

    bool found = false;

    for (int i = 0; i < envPaths.Length; i++) {

      if (File.Exists(Path.Combine(envPaths[i], "Oci.dll"))) {

        found = true;

        break;

      }

    }

    if (!found)

      throw new Exception("Can not obtain Oracle client information from registry. Check if Oracle client software installed.");

Otherwise, you can use our provider in the Direct mode when Oracle client is not used. For more information, please refer to http://www.devart.com/dotconnect/oracle ... Using.html , the Using Direct Mode section.
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44

Postby mrs5088 » Thu 09 Jul 2009 13:32

1. I have oracle Instant Client installed on the PC. Does this rule out the cause # 1? However on my development I have Oracle 9.2.0.4 client installed. Does the client PC also need Oracle client 9204 and not Instant Client?

2. In my app, there is no tag. On my development PC, this runs fine without this tag. So I'm guessing this isn't the problem. What do you think?

3. I will have the client check if it's an issue with the path variable for the OCI.dll.

Thanks
mrs5088
 
Posts: 7
Joined: Fri 20 Feb 2009 17:12

Postby Shalex » Thu 09 Jul 2009 14:20

1. It is enough to have Instant Client installed.

2. Try to set the following entry to the web.config file of your web application explicitly to make sure this is not permissions stuff:
Code: Select all

 
   
 

Please refer to
http://msdn.microsoft.com/en-us/library/tkscy493.aspx
http://msdn.microsoft.com/en-us/library/ms998341.aspx
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44

Postby mrs5088 » Fri 10 Jul 2009 22:25

Hi,
I installed instant client on a new PC to test if I can connect to the database. I was not able to connect. When I launch Entity Developer, it doesn't recognize my database. I get the following error.
---------------------------
Entity Developer for dotConnect
---------------------------
ORA-12154: TNS:could not resolve the connect identifier specified
---------------------------
OK
---------------------------

Thanks
Mahipal
mrs5088
 
Posts: 7
Joined: Fri 20 Feb 2009 17:12

Postby Shalex » Mon 13 Jul 2009 14:18

This is a general (not provider-specific) error. Here are the common recommendations if you connect via OCI:
  • Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
  • Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.
  • Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.
  • Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA file may make it unusable.
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44

Can not load Oracle client library oci.dll from home

Postby mrs5088 » Tue 14 Jul 2009 13:27

Hi,
The client keeps getting the following error when they deploy the ASP.NET web application.

Environment
VMware Virtual Server hosting windows server 2003 OS
ASP.NET 3.5 sp1
Devart dotConnect for Oracle 5.0 Professional
Oracle Client 10g (tried both instant client and full client)
IIS 6.0

I have set the trust level to full in the web.config and oracle path looks fine. I'm not sure what's going on...I'm pasting some web.config details below.
web.config




















ERROR


Can not load Oracle client library oci.dll from home .
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Can not load Oracle client library oci.dll from home .

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FileNotFoundException: Can not load Oracle client library oci.dll from home .]
Devart.Data.Oracle.OracleHome.get_ClientVersion() +491
Devart.Data.Oracle.an.a(Boolean A_0, Boolean A_1, OracleHome A_2) +36
Devart.Data.Oracle.OracleInternalConnection..ctor(y connectionOptions, OracleInternalConnection proxyConnection) +382
Devart.Data.Oracle.by.a(i A_0, Object A_1, DbConnectionBase A_2) +116
Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, i A_1) +43
Devart.Common.DbConnectionPoolGroup.c(DbConnectionPool A_0) +18
Devart.Common.DbConnectionPool.a() +44
Devart.Common.DbConnectionPool.GetObject() +411
Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0) +77
Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection) +144
Devart.Common.DbConnectionBase.Open() +30
Devart.Data.Oracle.OracleConnection.Open() +267
Devart.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) +314

[ProviderException: An exception occurred. Please contact your administrator.]
Devart.Common.Web.Providers.DbMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object userId, MembershipCreateStatus& status) +1807
System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +318
System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +102
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +418
System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +161
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565[/b]
mrs5088
 
Posts: 7
Joined: Fri 20 Feb 2009 17:12

Postby Shalex » Tue 14 Jul 2009 14:51

Please check if your application has enough permissions to execute this code (this check is performed inside our assembly):
Code: Select all
          FileVersionInfo verInfo = null;
          if (File.Exists("C:\pathtofile\oci.dll")) {
            verInfo = FileVersionInfo.GetVersionInfo("C:\pathtofile\oci.dll");
          }
          if (verInfo == null || verInfo.FileVersion == null) {
            throw new System.IO.FileNotFoundException();
          }

If you get System.IO.FileNotFoundException, you need to configure your application to give it enough permissions to execute this code.
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle