[infinispan-issues] [JBoss JIRA] (ISPN-5449) HotRod ISPN000136: Execution error java.lang.ClassCastException: [B cannot be cast to org.infinispan.container.entries.CacheEntry - See more at: https://developer.jboss.org/thread/257699#sthash.ibv3Nflq.dpuf

Galder Zamarreño (JIRA) issues at jboss.org
Wed May 13 08:23:19 EDT 2015


    [ https://issues.jboss.org/browse/ISPN-5449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13067647#comment-13067647 ] 

Galder Zamarreño commented on ISPN-5449:
----------------------------------------

Based on your description, seems like you are starting your own Hot Rod server in the code instead of running the Infinispan Server itself. Do you get the same issue if you are running against standalone Infinispan Server and putting your configuration in the server itself?

You seem to have all the pieces to create a unit test, since you create your own HR server, building the cache manager behind it...etc. For compatibility test ideas, you should check here: https://github.com/infinispan/infinispan/tree/master/integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility

Finally, if you want to keep compatibility enabled, and you want the server to store data in byte[] format, you should not enable  {{storeAsBinary}}. Instead, you should disable that, and set {{dataContainer.valueEquivalence}} to {{org.infinispan.commons.equivalence.ByteArrayEquivalence}}. This scenario is tested in https://github.com/infinispan/infinispan/blob/master/integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/ByteArrayValueDistEmbeddedHotRodTest.java test


> HotRod ISPN000136: Execution error java.lang.ClassCastException: [B cannot be cast to org.infinispan.container.entries.CacheEntry - See more at: https://developer.jboss.org/thread/257699#sthash.ibv3Nflq.dpuf
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISPN-5449
>                 URL: https://issues.jboss.org/browse/ISPN-5449
>             Project: Infinispan
>          Issue Type: Bug
>    Affects Versions: 7.2.1.Final
>            Reporter: Enrico Olivelli
>            Assignee: Galder Zamarreño
>             Fix For: 7.2.2.Final
>
>
> Hi,
> I'm going to  upgrade to Infinspan 7.2.1final but I got into a showstopper. This error occours very frequently and the cluster becomes not usable.
>  
> In dev enviroment I'm using only Java HotRod clients and 3 Java HotRod Servers. When I put a "byte[]" in a cache then the following error occurs.
> Using only one Hotrod server the error does not occur.
>  
>  
> ERROR interceptors.InvocationContextInterceptor: ISPN000136: Execution error
> java.lang.ClassCastException: [B cannot be cast to org.infinispan.container.entries.CacheEntry
>       at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitGetCacheEntryCommand(BaseTypeConverterInterceptor.java:118)
>       at org.infinispan.commands.read.GetCacheEntryCommand.acceptVisitor(GetCacheEntryCommand.java:39)
>       at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)
>       at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102)
>       at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71)
>       at org.infinispan.commands.AbstractVisitor.visitGetCacheEntryCommand(AbstractVisitor.java:91)
>       at org.infinispan.commands.read.GetCacheEntryCommand.acceptVisitor(GetCacheEntryCommand.java:39)
>       at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336)
>       at org.infinispan.cache.impl.CacheImpl.getCacheEntry(CacheImpl.java:437)
>       at org.infinispan.cache.impl.DecoratedCache.getCacheEntry(DecoratedCache.java:547)
>       at org.infinispan.server.hotrod.CacheDecodeContext.get(CacheDecodeContext.scala:180)
>       at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeKey(HotRodDecoder.scala:103)
>       at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:48)
>       at org.infinispan.server.hotrod.HotRodDecoder$$anon$1.run(HotRodDecoder.scala:206)
>       at org.infinispan.server.hotrod.HotRodDecoder$$anon$1.run(HotRodDecoder.scala:205)
>       at org.infinispan.security.Security.doAs(Security.java:143)
>       at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:205)
>       at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45)
>       at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370)
>       at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168)
>       at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31)
>       at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32)
>       at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31)
> ....
>  
>  
> Cache Server configuration:
> Configuration wildcard = new ConfigurationBuilder()
>                     .locking().lockAcquisitionTimeout(lockAcquisitionTimeout)
>                     .concurrencyLevel(10000).isolationLevel(IsolationLevel.READ_COMMITTED).useLockStriping(true)
>                     .clustering()
>                     .cacheMode(CacheMode.DIST_SYNC)
>                     .l1().lifespan(l1ttl).enable()
>                     .hash().numOwners(numOwners).capacityFactor(capacityFactor)
>                     .partitionHandling().enabled(false)
>                     .stateTransfer().awaitInitialTransfer(false).timeout(initialTransferTimeout).fetchInMemoryState(false)
>                     .storeAsBinary().enabled(true).storeKeysAsBinary(false).storeValuesAsBinary(false)
>                     .jmxStatistics().enable()
>                     .unsafe().unreliableReturnValues(true) // put e remove non ritornano il valore precedente, tanto a noi non interessa               
>                     .compatibility().enable()
>                     .build();
>  
> Hotrod Endpoint:
> HotRodServerConfigurationBuilder configBuilder = new HotRodServerConfigurationBuilder()
>                         .host(address)
>                         .port(port);       
> hotrodserver.start(configBuilder
>                         .build(),
>                         manager);
>  
> Client side config:
> org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder().forceReturnValues(false);                   
> clientBuilder.nearCache().mode(NearCacheMode.LAZY).maxEntries(10000);   
> (for each server....)   
> clientBuilder.addServer().host(serveraddress).port(serverport);
> RemoteCacheManager remoteCacheManager = new RemoteCacheManager(clientBuilder.build());
> - See more at: https://developer.jboss.org/thread/257699#sthash.ibv3Nflq.dpuf



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)



More information about the infinispan-issues mailing list