Use of 32-bit COM dll in 64 bit AMSG and CLR IT environment

Use of 32-bit COM dll in 64 bit AMSG and CLR IT environment

book

Article ID: KB0090381

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix Service Grid -
Not Applicable -

Description

Resolution:
Abstract:
===========
While using a 32-bit COM dll in 64-bit environment, user may run into exceptions like "java.lang.Exception: com.tibco.clr.clrhost.TException: Could not load file or assembly" or "Class not registered" errors.


Environments:
============

ActiveMatrix Service Grid 3.2.0
ActiveMatrix Implementation Type for Microsoft CLR 3.2.0
Any Windows OS


Description:
=========

If a .Net project (which in turn refers to a 32-bit COM dll) is build with "x86" as Target CPU option, user may run into following error while deploying daa for this wcf service-

-----------

java.lang.Exception: com.tibco.clr.clrhost.TException: Could not load file or assembly 'TValueService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
caused by: com.tibco.clr.clrhost.TException: Could not load file or assembly 'TValueService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
----------



This error can be resolved by compiling project with "AnyCPU" option but user may run into the another error since this project calls 32-bit com dll -

--------------
Caused by: java.lang.RuntimeException: Retrieving the COM class factory for component with CLSID {3250B0F2-8909-4F94-B519-EC7E75EA985B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)(Unknown Source)

    at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)(Unknown Source)

    at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)(Unknown Source)

    at System.Activator.CreateInstance(Type type, Boolean nonPublic)(Unknown Source)

    at System.Activator.CreateInstance(Type type)(Unknown Source)

    at TValueSvc.TValueSvc.GetApr(AprRequest objRequest)(Unknown Source)

    at .SyncInvokeGetApr(Object , Object[] , Object[] )(Unknown Source)

-------------------


Resolution:
=========

From the error details, it looks like the COM dll is not registered on the machine.  User may need to register it on the Server where this call is getting executed.

Please use following command to register this dll:

%SystemRoot%\Syswow64\regsvr32.exe '&ltabsolute path to COM dll>'.


Uninstall and Delete the application from admin GUI and try to deploy the application again.

If there are errors while registering the COM dll or user gets the same error while deploying the application again, then user needs to setup a 32-bit environment with dll compiled to target “x86” cpu, as the underlying COM technology does not always work on 64-bit environment.


Attachments:
===========
N/A

References:
==========
N/A

Issue/Introduction

Use of 32-bit COM dll in 64 bit AMSG and CLR IT environment