-
Bug
-
Resolution: Done
-
Major
-
None
-
6.0.1.Final
-
None
-
None
When enabling the "storeAsBinary" mode, I'm getting a ClassCastException when putting an element into a FineGrainedAtomicMap<String, Object>:
Configuration configuration = new ConfigurationBuilder() .storeAsBinary() .enable() .transaction() .transactionMode(TransactionMode.TRANSACTIONAL ) .transactionManagerLookup(new JBossStandaloneJTAManagerLookup() ) .build(); EmbeddedCacheManager manager = new DefaultCacheManager(); manager.defineConfiguration( "testCache", configuration ); Cache<String, Object> cache = manager.getCache( "testCache", true ); String rowKey = "Some Key"; FineGrainedAtomicMap<String, Object> map = AtomicMapLookup.getFineGrainedAtomicMap( cache, rowKey, true ); // Causes ClassCastException map.put( "the key", "the value" );
The strack trace is:
java.lang.ClassCastException: org.infinispan.marshall.core.MarshalledValue cannot be cast to org.infinispan.atomic.DeltaAware
at org.infinispan.container.EntryFactoryImpl.wrapInternalCacheEntryForDelta(EntryFactoryImpl.java:245)
at org.infinispan.container.EntryFactoryImpl.wrapEntryForDelta(EntryFactoryImpl.java:235)
at org.infinispan.container.EntryFactoryImpl.wrapEntryForDelta(EntryFactoryImpl.java:218)
at org.infinispan.interceptors.EntryWrappingInterceptor.visitApplyDeltaCommand(EntryWrappingInterceptor.java:209)
at org.infinispan.commands.write.ApplyDeltaCommand.acceptVisitor(ApplyDeltaCommand.java:86)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitApplyDeltaCommand(OptimisticLockingInterceptor.java:114)
at org.infinispan.commands.write.ApplyDeltaCommand.acceptVisitor(ApplyDeltaCommand.java:86)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:112)
at org.infinispan.commands.AbstractVisitor.visitApplyDeltaCommand(AbstractVisitor.java:62)
at org.infinispan.commands.write.ApplyDeltaCommand.acceptVisitor(ApplyDeltaCommand.java:86)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:112)
at org.infinispan.commands.AbstractVisitor.visitApplyDeltaCommand(AbstractVisitor.java:62)
at org.infinispan.commands.write.ApplyDeltaCommand.acceptVisitor(ApplyDeltaCommand.java:86)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:255)
at org.infinispan.interceptors.TxInterceptor.visitApplyDeltaCommand(TxInterceptor.java:191)
at org.infinispan.commands.write.ApplyDeltaCommand.acceptVisitor(ApplyDeltaCommand.java:86)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:112)
at org.infinispan.commands.AbstractVisitor.visitApplyDeltaCommand(AbstractVisitor.java:62)
at org.infinispan.commands.write.ApplyDeltaCommand.acceptVisitor(ApplyDeltaCommand.java:86)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:110)
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:73)
at org.infinispan.commands.AbstractVisitor.visitApplyDeltaCommand(AbstractVisitor.java:62)
at org.infinispan.commands.write.ApplyDeltaCommand.acceptVisitor(ApplyDeltaCommand.java:86)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:333)
at org.infinispan.CacheImpl.applyDelta(CacheImpl.java:666)
at org.infinispan.atomic.FineGrainedAtomicHashMapProxy.invokeApplyDelta(FineGrainedAtomicHashMapProxy.java:274)
at org.infinispan.atomic.FineGrainedAtomicHashMapProxy.put(FineGrainedAtomicHashMapProxy.java:207)
The issue does not occur when using a custom key type instead of String.