Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 115
Registered: ‎04-05-2016
Accepted Solution

GMSC 16.5: Server API Error connecting to Oracle database

Hello,

 

I desperately need help with getting a GMSC plugin which is using the GMSC Server API to work.

 

The plugin is utilizing a WCF-service on the server which fetches information from the GMSC admin database and returns it to the client. It worked fine in my GMSC 2016 SP1 environment but it does not run under GMSC 16.5 (2018). There seems to be a problem with compartibility with the ODAC installation (ODAC 12.2.0).

 

The code crashes when creating the Db connection in the CreateConnection-method:

using (IDatabaseProvider dbProvider = DBProviderFactory.CreateDatabaseProvider(DBProviderTypeResolver.FromType("Intergraph.Emea.Data.OracleProvider")))
            {
                using (DbConnection dbConnection = dbProvider.CreateConnection("Data Source=XXX;User ID=XXX;Password=XXX"))
                {
                }
            }

 

and throws the following error:

Exception thrown: 'System.TypeInitializationException' in Oracle.DataAccess.dll
"The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception."
"Oracle.DataAccess"
"   at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)\r\n   at Intergraph.Emea.Data.OracleProvider.CreateConnection(String connectionString, Workspace workspace)\r\n   at

...

Inner Exception:

{"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"}
"   at Oracle.DataAccess.Client.OpsInit.CheckVersionCompatibility(String version)\r\n   at Oracle.DataAccess.Client.OracleInit.Initialize()\r\n   at Oracle.DataAccess.Client.OracleConnection..cctor()"

 

Any ideas?

 

Thanks and kind regards,

Sven

Technical Evangelist
Posts: 1,118
Registered: ‎09-11-2015

Re: GMSC 16.5: Server API Error connecting to Oracle database

Hi Sven,

 

I am by no means expert on GMSC plugin development, but the exception looks like a typical x86 / x64 conflict. Are you sure that you've built the project in 64-bit mode? (I suppose it should be 64-bit as ODAC 64-bit is required by SmartClient)

 

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Frequent Contributor
Posts: 115
Registered: ‎04-05-2016

Re: GMSC 16.5: Server API Error connecting to Oracle database

Hi Jan,

 

first of all thanks for the swift reply.

 

Yes the application is running in 64 bit mode and I can also see in Visual Studio that it is loading the 64bit Oracle.DataAcess.dll from the .NEt assembly cache

Frequent Contributor
Posts: 115
Registered: ‎04-05-2016

Re: GMSC 16.5: Server API Error connecting to Oracle database

Okay, nevermind. I have found the problem. Apparently something was wrong with my Oracle installation. I uninstalled Oracle 12.2 client and had to manually unregister the assemblies from the Windows and the .NET assembly cache. Then I installed Oracle 12.1 client and reconfigured the GMSC installation. Now it works.

 

There is a know problem with Oracle 12.2 client that isn't registering ODAC assemblies correctly. In the previous installation I had to register them manually in order to make GMSC work. Maybe something went wrong there. the 12.1 installer does the registration correctly and doesn't have such problems.

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.