Coherence Throws Java.lang.ClassCastException: com.tangosol.util.Binary Cannot Be Cast To Java.lang.String (Doc ID 2190503.1)

Last updated on JULY 24, 2017

Applies to:

Oracle Coherence - Version 12.2.1.1.0 and later
Information in this document applies to any platform.

Symptoms

On : 12.2.1.1.0 version, Oracle Coherence

When attempting to fire onMapEvent method the following error occurs.

2016-09-22 14:29:56.958/95.152 Oracle Coherence GE 12.2.1.1.0 (thread=CacheInvalidationServiceWorker:0x0000:5, member=1): java.lang.ClassCastException: com.tangosol.util.Binary cannot be cast to java.lang.String
at com.carrefour.coherence.GenericCacheInvalidatorListener.onMapEvent(GenericCacheInvalidatorListener.java:38)
at com.tangosol.util.MultiplexingMapListener.entryInserted(MultiplexingMapListener.java:33)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:230)
at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:734)
at com.tangosol.net.cache.ReadWriteBackingMap$InternalMapListener.dispatch(ReadWriteBackingMap.java:2480)
at com.tangosol.net.cache.ReadWriteBackingMap$InternalMapListener.entryInserted(ReadWriteBackingMap.java:2338)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:230)
at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:734)
at com.tangosol.net.cache.OldCache.dispatchEvent(OldCache.java:1946)
at com.tangosol.net.cache.OldCache$Entry.onAdd(OldCache.java:2042)
at com.tangosol.util.SafeHashMap.put(SafeHashMap.java:246)
at com.tangosol.net.cache.OldCache.put(OldCache.java:238)
at com.tangosol.net.cache.ReadWriteBackingMap.putToInternalMap(ReadWriteBackingMap.java:908)
at com.tangosol.net.cache.ReadWriteBackingMap.putInternal(ReadWriteBackingMap.java:1488)
at com.tangosol.net.cache.ReadWriteBackingMap.put(ReadWriteBackingMap.java:1069)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.putPrimaryResource(PartitionedCache.CDB:48)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.postPut(PartitionedCache.CDB:29)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.put(PartitionedCache.CDB:31)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onPutRequest(PartitionedCache.CDB:53)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$PutRequest.run(PartitionedCache.CDB:1)
at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:1)
at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:32)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService$DaemonPool$WrapperTask.run(PartitionedService.CDB:1)
at com.tangosol.coherence.component.util.DaemonPool$Daemon.onNotify(DaemonPool.CDB:66)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:54)
at java.lang.Thread.run(Thread.java:745)

 Sample code snippet

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms