Hi Aaron!

Is it possible that you wrote a value to cache before configuring an
affinity key?
This exception occurs when configuration of affinity key for a sought key
doesn't match configuration that is stored in cache.
Maybe you have persistence enabled and you wrote the value before adding
@AffinityKeyMapped to field of AssetKey class?

Denis

вт, 19 сент. 2017 г. в 13:10, [email protected] <[email protected]>:

> hi all,
>
> We using the affinity key map to affinity cache connected,  the key is a
> very simple class:
>
> class AssetKey
>
> @AffinityKeyMapped
> private String accountId;
> private String transId;
>
>
> But every time when run this command from client:
>
> ignite.<AssetKey, AssetEntry>cache(AssetEntry.IG_CACHE_NAME).invoke(new
> AssetKey(..), (entry, arguments)....)
>
> A exception always thrown:
>
>
> Caused by: class org.apache.ignite.binary.BinaryObjectException: Binary type 
> has different affinity key fields [typeName=AssetKey, affKeyFieldName1=null, 
> affKeyFieldName2=accountId]
>
> at 
> org.apache.ignite.internal.binary.BinaryUtils.mergeMetadata(BinaryUtils.java:950)
>
> at 
> org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl.addMeta(CacheObjectBinaryProcessorImpl.java:430)
>
> at 
> org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$2.addMeta(CacheObjectBinaryProcessorImpl.java:173)
>
> For Ignite configuration we put this:
>
> <property name="cacheKeyConfiguration">
>             <list>
>
>                 <bean class="org.apache.ignite.cache.CacheKeyConfiguration">
>                     <constructor-arg value="AssetKey"/>
>                 </bean>
>             </list>
> </property>
>
>
> Any configuration we missed?  Thanks for your time!
>
>
>
> Regards
> Aaron
> ------------------------------
> [email protected]
>

Reply via email to