Question

I'm using oracle coherence in my C# project. .Net project has references to Coherence and it sets some Coherence properties by 'injecting' my types. One of the examples if POF configuration:

<user-type>
  <type-id>1008</type-id>
  <class-name>MyTypeName, MyAssembly, version=1.2.3.4, publicKeyToken=0f73b23f05811dc2</class-name>
</user-type>

Even though all my types are specified by using full name with version and public key token, Coherence doesn't use it and binds to MyAssembly.

It's a big problem for me bacause MyAssembly is in GAC and binding fails. Of course I can use an application config and set:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <qualifyAssembly partialName="MyAssembly" fullName="MyAssembly,Version=1.2.3.4,publicKeyToken=0f73b23f05811dc2,culture=neutral" />
</assemblyBinding>

But I would like to avoid that (not every application can have a app.config - like PowerShell).

In Oracle documentation http://docs.oracle.com/cd/E18686_01/coh.37/e18678/net_intobjects.htm#BABJCBDD I found that:

You need not specify a fully qualified type name within the class-name element. The type and assembly name is enough.

But what if I want to specify fully qualified name?

--Edit

Right new the issue I'm having is with the tangosol-coherence.override.xml:

<security-config>
    <identity-transformer>
      <class-name>MyAssembly.IdentityTransformer, MyAssembly, Version=1.2.3.4, publicKeyToken=0f73b23f05811dc2, culture=neutral</class-name>
    </identity-transformer>
    <principal-scope>false</principal-scope>
</security-config>

the exception I get:

Failed to instantiate class "MyAssembly.IdentityTransformer, MyAssembly, Version=1.2.3.4, publicKeyToken=0f73b23f05811dc2, culture=neutral"
MyAssembly.IdentityTransformer, MyAssembly, Version=1.2.3.4, publicKeyToken=0f73b23f05811dc2, culture=neutral

in Assembly Binding Log Viewer:

WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: MyAssembly, Version=1.2.3.4 | Domain ID: 1

Calling assembly : Coherence, Version=3.7.1.3, Culture=neutral, PublicKeyToken=0ada89708fdf1f9a.

Was it helpful?

Solution

I solved that issue by analysing Coherence disassembled dll.

It looks like:

Tangosol.Util.TypeResolver.Resolve(typeName);

cannot resolve type when it specified like this:

MyAssembly.IdentityTransformer, MyAssembly, Version=1.2.3.4, publicKeyToken=0f73b23f05811dc2, culture=neutral

but it can when it's specified like this:

MyAssembly.IdentityTransformer, MyAssembly, Version=1.2.3.4, Culture=neutral, PublicKeyToken=0f73b23f05811dc2

So modyfing the tangosol-coherence.override.xml fixed it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top