ORA-12154

ORA-12154

Postby sa » Fri 28 Aug 2009 12:31

Hello,

I got a problem with your oracle provider.
The software I'm developing works well on my computer, but I got a problem when I try to install it on the demo server.

The demo server is a 64bits server. But Oracle is installed in 32bits.
My software uses Entity Framework.

In order to see if the problem could be anything else, I developed a console application with only an EDMX file which contains only one table. The console application lists the items in the datatable.

Here is the error message, the stack trace and the innerexception:

Code: Select all
The underlying provider failed on Open. /
   à System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean ope
nCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection,
String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionO
nFailure)
   à System.Data.EntityClient.EntityConnection.Open()
   à System.Data.Objects.ObjectContext.EnsureConnection()
   à System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   à System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable
.GetEnumerator()
   à System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   à System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   à TestDevart.Program.Main(String[] args)
ORA-12154: TNS : l'identificateur de connexion indiqué n'a pas pu être résolu /

   à Devart.Data.Oracle.al.b(Int32 A_0)
   à Devart.Data.Oracle.ar.a(y A_0, at A_1)
   à Devart.Data.Oracle.OracleInternalConnection..ctor(y connectionOptions, Orac
leInternalConnection proxyConnection)
   à Devart.Data.Oracle.by.a(h A_0, Object A_1, DbConnectionBase A_2)
   à Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, h A_1)
   à Devart.Common.DbConnectionPoolGroup.c(DbConnectionPool A_0)
   à Devart.Common.DbConnectionPool.a()
   à Devart.Common.DbConnectionPool.GetObject()
   à Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0)
   à Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   à Devart.Common.DbConnectionBase.Open()
   à Devart.Data.Oracle.OracleConnection.Open()
   à System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean ope
nCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection,
String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionO
nFailure)


Both oracle server and client are installed on the server.
Please help.

Sébastien
sa
 
Posts: 5
Joined: Fri 28 Aug 2009 12:17

Postby Shalex » Fri 28 Aug 2009 13:02

Have you registered dotConnect for Oracle in app.config of your application or in machine.config of your deployment server? Please refer to http://www.devart.com/dotconnect/oracle ... es/ef.html , the Deploying an Entity Framework Project section.
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44

Postby sa » Fri 28 Aug 2009 13:27

Here is my App.Config

Code: Select all


 
   
 

 
   
     
   

 


sa
 
Posts: 5
Joined: Fri 28 Aug 2009 12:17

Postby Shalex » Mon 31 Aug 2009 08:28

Please make sure your connection string is valid for your deployment server (create an OracleConnection object and try to open it). For example, if you use the TNS name from the tnsnames.ora file of your development server, but there is no such entry in tnsnames.ora of your deployment server - you will get the same ORA-12154 exeption. Please refer to http://ora-12154.ora-code.com/ .
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44

Postby sa » Wed 02 Sep 2009 12:24

My app was installed in the Program Files(x86) folder on the deployement server. And it didn't work there.

So I moved it to another folder which is not in the Program Files(x86) folder and now it works for my little test console application.

Is it normal? What can I do if I still want to install my application in the x86 folder?

After that, I tried to install my main app in a 64bit folder. But now I don't have the same error. Here is the error:

Code: Select all
Impossible de charger le fichier ou l'assembly 'myApp.Business' ou une de ses dépendances. Tentative de chargement d'un programme de format incorrect.
Description : Une exception non gérée s'est produite au moment de l'exécution de la demande Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.

Détails de l'exception: System.BadImageFormatException: Impossible de charger le fichier ou l'assembly 'myApp.Business' ou une de ses dépendances. Tentative de chargement d'un programme de format incorrect.

Erreur source:

Une exception non gérée s'est produite lors de l'exécution de la demande Web actuelle. Les informations relatives à l'origine et l'emplacement de l'exception peuvent être identifiées en utilisant la trace de la pile d'exception ci-dessous. 

Suivi du chargement de l'assembly: Les informations suivantes peuvent permettre de déterminer la raison pour laquelle l'assembly 'myApp.Business' n'a pas pu être chargé.


=== Informations d'état de liaison préalable ===
JRN : utilisateur = AUTORITE NT\SERVICE RÉSEAU
JRN : DisplayName = myApp.Business
(Partial)
JRN : Appbase = file:///C:/myAppPath/
JRN : PrivatePath initial = C:\myAppPath\bin
Assembly appelant : (Unknown).
===
JRN : cette liaison démarre dans le contexte de chargement de default.
JRN : utilisation du fichier de configuration de l'application : C:\myAppPath\web.config
JRN : utilisation du fichier de configuration d'hôte : \?\C:\WINDOWS\microsoft.net\Framework64\v2.0.50727\aspnet.config
JRN : utilisation du fichier de configuration de l'ordinateur à partir de c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
JRN : stratégie non appliquée à la référence à ce stade (liaison d'assembly privée, personnalisée, partielle ou basée sur l'emplacement).
JRN : tentative de téléchargement de la nouvelle URL file:///c:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/3125f08f/7033092c/myApp.Business.DLL.
JRN : tentative de téléchargement de la nouvelle URL file:///c:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/3125f08f/7033092c/myApp.Business/myApp.Business.DLL.
JRN : tentative de téléchargement de la nouvelle URL file:///C:/myAppPath/bin/myApp.Business.DLL.
ERR : impossible de terminer l'installation de l'assembly (hr = 0x8007000b). Détection terminée.



Stack trace:


[BadImageFormatException: Impossible de charger le fichier ou l'assembly 'myApp.Business' ou une de ses dépendances. Tentative de chargement d'un programme de format incorrect.]
   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416
   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190

[ConfigurationErrorsException: Impossible de charger le fichier ou l'assembly myApp.Business' ou une de ses dépendances. Tentative de chargement d'un programme de format incorrect.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11200744
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +388
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +232
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +210
   System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +76
   System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +281
   System.Web.Compilation.BuildManager.CompileGlobalAsax() +50
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +676

[HttpException (0x80004005): Impossible de charger le fichier ou l'assembly myApp.Business' ou une de ses dépendances. Tentative de chargement d'un programme de format incorrect.]
   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +76
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +1012
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +1025

[HttpException (0x80004005): Impossible de charger le fichier ou l'assembly 'myApp.Business' ou une de ses dépendances. Tentative de chargement d'un programme de format incorrect.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11294470
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +11168168


This error doesn't happen when I'm in the program files(x86) folder.

In the setup application, what is the target plateform i am supposed to set? x86, x64 or Itanium?

Can someone help me please?

Thanks
sa
 
Posts: 5
Joined: Fri 28 Aug 2009 12:17

Postby Shalex » Wed 02 Sep 2009 15:26

This is an Oracle client's issue (brackets in the path). It is fixed in the latest versions of Oracle Client.
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44

Postby sa » Thu 03 Sep 2009 07:18

Unfortunately I can't install a later oracle client.

But now, the app is installed in another folder and the path doesn't contain any brackets and the error is still here.

In the setup application, what is the target plateform i am supposed to set? x86, x64 or Itanium?

Thanks for replies
sa
 
Posts: 5
Joined: Fri 28 Aug 2009 12:17

Postby sa » Thu 03 Sep 2009 09:55

IIS 6 is installed on the deployement server. And IIS 6 is in 64bits.
Does the problem may come from this?

Thanks
sa
 
Posts: 5
Joined: Fri 28 Aug 2009 12:17

Postby ColinBo » Thu 03 Sep 2009 18:09

IIS 6 is installed on the deployement server. And IIS 6 is in 64bits.


If is IIS is running in 64-bit mode (that is, the Enable32BitAppOnWin64 metabase setting is false), then your worker process is running in a 64-bit mode. This will mean that you can only bind to assemblies compiled for MSIL or x64. You can determine if the assembly is compiled for 32-bit, 64-bit, or MSIL (compile using just-in-time compiler for the specific machine) using CORFLAGS.EXE. You can play with the bitness flag but only do so with caution. Everything needs to line up to be 32-bit and MSIL or 64-bit and MSIL. If your Oracle client is 32-bit then your worker process needs to be 32-bit. Alternatively using the Direct mode in the dotConnect connection string will do a straight TCP/IP connection without the need for the Oracle client.

In the notes above it looks like the problem is that your assembly, myApp.Business.dll, may be compiled for 32-bit only and the CLR is looking for a 64-bit version.

Cheers,
Colin[/quote]
ColinBo
 
Posts: 9
Joined: Thu 27 Aug 2009 17:27
Location: Toronto, Canada

Postby Shalex » Fri 04 Sep 2009 08:56

As for the brackets bug (resolved in Oracle Client v 11): if you deploy your application via debug web server, be aware it resides at \Program Files (x86)\Common Files\microsoft shared\DevServer\9.0\WebDev.WebServer.EXE .
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle