[JBoss JIRA] (ISPN-5458) Broken modules due to circular dependencies
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-5458?page=com.atlassian.jira.plugin.... ]
Dan Berindei reassigned ISPN-5458:
----------------------------------
Assignee: Gustavo Fernandes
> Broken modules due to circular dependencies
> -------------------------------------------
>
> Key: ISPN-5458
> URL: https://issues.jboss.org/browse/ISPN-5458
> Project: Infinispan
> Issue Type: Bug
> Components: Build process
> Reporter: Gustavo Fernandes
> Assignee: Gustavo Fernandes
> Priority: Critical
>
> There's still a circular dependency hell between hibernate search 5.2. (depends on infinispan 7.2.0.Final) and Infinispan (depends on hibernate Search 5.2.0.Final), causing failures on master:
> {code}
> Caused by: java.lang.Exception: {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"master.war#pu-master\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"master.war#pu-master\": org.jboss.modules.ModuleLoadError: org.infinispan:ispn-7.2
> Caused by: org.jboss.modules.ModuleLoadError: org.infinispan:ispn-7.2"}}
> {code}
> There was an alias in place to mitigate that until hibernate search has infinispan dependency, but apparently it was removed on ISPN-5445
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 8 months
[JBoss JIRA] (ISPN-5463) ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
by Philippe Cuvecle (JIRA)
[ https://issues.jboss.org/browse/ISPN-5463?page=com.atlassian.jira.plugin.... ]
Philippe Cuvecle commented on ISPN-5463:
----------------------------------------
You're right, if I comment out the index in the server config, the issue disappears.
That said, after my put I have a query that actually also works. From my understanding, the indexing was required to be able to make query on object attributes.
> ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> --------------------------------------------------------------------------------------------------
>
> Key: ISPN-5463
> URL: https://issues.jboss.org/browse/ISPN-5463
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Querying
> Affects Versions: 7.2.1.Final
> Reporter: Philippe Cuvecle
> Assignee: Adrian Nistor
> Fix For: 7.2.2.Final, 8.0.0.Alpha1
>
>
> I try to use hotrod + protobuf + event notification and get a Class cast exception on Infinispan server side when trying to put an object
> Server side :
> ---------------
> Infinispan 7.2.1 in server mode
> I have declared my proto file in the MBean ProtobufMetadataManager
> Cache config :
> <replicated-cache name="myReplicatedCache" mode="SYNC" start="EAGER">
> <indexing index="ALL" auto-config="true"/>
> </replicated-cache>
> Client side
> -------------
> My cache object is modeled as a POJO with 5 string fields and its proto definition file
> I am able to put and get and even query successfully until I try to register a ClientListener. When doing this, the first put fails with this stacktrace :
> 16:37:36,186 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-5) ISPN000136: Execution error: org.infinispan.commons.CacheListenerException: ISPN000280: Caught exception [java.lang.ClassCastException] while invoking method [public void org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(org.infinispan.notifications.cachelistener.event.CacheEntryEvent)] on listener instance: org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender@3909d917
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:291) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl.invoke(AbstractListenerImpl.java:309) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.doRealInvocation(CacheNotifierImpl.java:1160) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1155) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1132) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryCreated(CacheNotifierImpl.java:290) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.notifyCommitEntry(ClusteringDependentLogic.java:138) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$InvalidationLogic.commitSingleEntry(ClusteringDependentLogic.java:331) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$ReplicationLogic.commitSingleEntry(ClusteringDependentLogic.java:372) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.commitEntry(ClusteringDependentLogic.java:108) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntry(EntryWrappingInterceptor.java:371) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:549) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:348) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:422) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:453) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:195) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:164)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:88) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:324) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:115) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:69) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:236) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:215) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:132) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:50) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:208) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32) [infinispan-server-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
> Caused by: java.lang.ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> at org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(ClientListenerRegistry.scala:183) [infinispan-server-hotrod.jar:7.2.1.Final]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:286) [infinispan-core.jar:7.2.1.Final]
> ... 73 more
> Client side code :
> ----------------------
> ...
> ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
> configurationBuilder.addServer().host(IP_ADDRESS).port(11222).marshaller(new ProtoStreamMarshaller());
> RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configurationBuilder.build());
> EventPrintListener listener = new EventPrintListener();
> SerializationContext srcCtx = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
> srcCtx.registerProtoFiles(FileDescriptorSource.fromResources("/myObject.proto"));
> srcCtx.registerMarshaller(new MyObjectMarshaller());
>
> // Obtain the cache
> RemoteCache<Integer, MyObject> remoteCache = remoteCacheManager.getCache("myReplicatedCache");
> // Add remote listener
> remoteCache.addClientListener(listener); // no issue if this is removed
>
> MyObject o = new MyObject();
> o.setA("XXXX");
> o.setB("YYYY");
> o.setC("ZZZZ");
> o.setD("AAAA");
> o.setE("BBBB");
>
> remoteCache.put(1, o); // server stacktrace
> Listener :
> -----------
> @ClientListener
> public class EventPrintListener<K> {
> @ClientCacheEntryCreated
> public void createdEntry(ClientCacheEntryCreatedEvent<K> event) {
> System.out.printf("** Key '%s' was created\n", event.getKey());
> }
> @ClientCacheEntryModified
> public void modifiedEntry(ClientCacheEntryModifiedEvent<K> event) {
> System.out.printf("** Key '%s' was modified\n", event.getKey());
> }
> @ClientCacheEntryRemoved
> public void removedEntry(ClientCacheEntryRemovedEvent<K> event) {
> System.out.printf("** Key '%s' was removed\n", event.getKey());
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 8 months
[JBoss JIRA] (ISPN-5403) NullPointerException on starting CacheStore
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-5403?page=com.atlassian.jira.plugin.... ]
Dan Berindei updated ISPN-5403:
-------------------------------
Status: Resolved (was: Pull Request Sent)
Fix Version/s: 8.0.0.Alpha1
Resolution: Done
> NullPointerException on starting CacheStore
> -------------------------------------------
>
> Key: ISPN-5403
> URL: https://issues.jboss.org/browse/ISPN-5403
> Project: Infinispan
> Issue Type: Bug
> Reporter: Sebastian Łaskawiec
> Assignee: Sebastian Łaskawiec
> Priority: Minor
> Fix For: 8.0.0.Alpha1
>
>
> Relevant stacktrace:
> {code}
> boss.infinispan.clustered.default: Failed to start service
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1936) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_31]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_31]
> Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.persistence.manager.PersistenceManagerImpl.start() on object of type PersistenceManagerImpl
> at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:171)
> at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:869)
> at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:638)
> at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:627)
> at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:530)
> at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:218)
> at org.infinispan.CacheImpl.start(CacheImpl.java:779)
> at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:587)
> at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:542)
> at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:420)
> at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:434)
> at org.jboss.as.clustering.infinispan.DefaultEmbeddedCacheManager.getCache(DefaultEmbeddedCacheManager.java:89)
> at org.jboss.as.clustering.infinispan.DefaultEmbeddedCacheManager.getCache(DefaultEmbeddedCacheManager.java:80)
> at org.infinispan.server.infinispan.SecurityActions$4.run(SecurityActions.java:104)
> at org.infinispan.server.infinispan.SecurityActions$4.run(SecurityActions.java:101)
> at org.infinispan.security.Security.doPrivileged(Security.java:76)
> at org.infinispan.server.infinispan.SecurityActions.doPrivileged(SecurityActions.java:48)
> at org.infinispan.server.infinispan.SecurityActions.startCache(SecurityActions.java:109)
> at org.jboss.as.clustering.infinispan.subsystem.CacheService.start(CacheService.java:85)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
> ... 3 more
> Caused by: org.infinispan.commons.CacheException: Unable to start cache loaders
> at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:156)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_31]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_31]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_31]
> at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_31]
> at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)
> ... 23 more
> Caused by: java.lang.NullPointerException
> at org.infinispan.persistence.factory.CacheStoreFactoryRegistry.processStoreConfiguration(CacheStoreFactoryRegistry.java:48)
> at org.infinispan.persistence.manager.PersistenceManagerImpl.createLoadersAndWriters(PersistenceManagerImpl.java:529)
> at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:114)
> ... 28 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 8 months
[JBoss JIRA] (ISPN-5463) ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
by Adrian Nistor (JIRA)
[ https://issues.jboss.org/browse/ISPN-5463?page=com.atlassian.jira.plugin.... ]
Adrian Nistor commented on ISPN-5463:
-------------------------------------
I would expect the exception disappears if you disable indexing, right?
> ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> --------------------------------------------------------------------------------------------------
>
> Key: ISPN-5463
> URL: https://issues.jboss.org/browse/ISPN-5463
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Querying
> Affects Versions: 7.2.1.Final
> Reporter: Philippe Cuvecle
> Assignee: Adrian Nistor
> Fix For: 7.2.2.Final, 8.0.0.Alpha1
>
>
> I try to use hotrod + protobuf + event notification and get a Class cast exception on Infinispan server side when trying to put an object
> Server side :
> ---------------
> Infinispan 7.2.1 in server mode
> I have declared my proto file in the MBean ProtobufMetadataManager
> Cache config :
> <replicated-cache name="myReplicatedCache" mode="SYNC" start="EAGER">
> <indexing index="ALL" auto-config="true"/>
> </replicated-cache>
> Client side
> -------------
> My cache object is modeled as a POJO with 5 string fields and its proto definition file
> I am able to put and get and even query successfully until I try to register a ClientListener. When doing this, the first put fails with this stacktrace :
> 16:37:36,186 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-5) ISPN000136: Execution error: org.infinispan.commons.CacheListenerException: ISPN000280: Caught exception [java.lang.ClassCastException] while invoking method [public void org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(org.infinispan.notifications.cachelistener.event.CacheEntryEvent)] on listener instance: org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender@3909d917
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:291) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl.invoke(AbstractListenerImpl.java:309) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.doRealInvocation(CacheNotifierImpl.java:1160) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1155) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1132) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryCreated(CacheNotifierImpl.java:290) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.notifyCommitEntry(ClusteringDependentLogic.java:138) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$InvalidationLogic.commitSingleEntry(ClusteringDependentLogic.java:331) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$ReplicationLogic.commitSingleEntry(ClusteringDependentLogic.java:372) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.commitEntry(ClusteringDependentLogic.java:108) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntry(EntryWrappingInterceptor.java:371) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:549) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:348) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:422) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:453) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:195) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:164)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:88) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:324) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:115) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:69) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:236) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:215) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:132) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:50) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:208) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32) [infinispan-server-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
> Caused by: java.lang.ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> at org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(ClientListenerRegistry.scala:183) [infinispan-server-hotrod.jar:7.2.1.Final]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:286) [infinispan-core.jar:7.2.1.Final]
> ... 73 more
> Client side code :
> ----------------------
> ...
> ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
> configurationBuilder.addServer().host(IP_ADDRESS).port(11222).marshaller(new ProtoStreamMarshaller());
> RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configurationBuilder.build());
> EventPrintListener listener = new EventPrintListener();
> SerializationContext srcCtx = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
> srcCtx.registerProtoFiles(FileDescriptorSource.fromResources("/myObject.proto"));
> srcCtx.registerMarshaller(new MyObjectMarshaller());
>
> // Obtain the cache
> RemoteCache<Integer, MyObject> remoteCache = remoteCacheManager.getCache("myReplicatedCache");
> // Add remote listener
> remoteCache.addClientListener(listener); // no issue if this is removed
>
> MyObject o = new MyObject();
> o.setA("XXXX");
> o.setB("YYYY");
> o.setC("ZZZZ");
> o.setD("AAAA");
> o.setE("BBBB");
>
> remoteCache.put(1, o); // server stacktrace
> Listener :
> -----------
> @ClientListener
> public class EventPrintListener<K> {
> @ClientCacheEntryCreated
> public void createdEntry(ClientCacheEntryCreatedEvent<K> event) {
> System.out.printf("** Key '%s' was created\n", event.getKey());
> }
> @ClientCacheEntryModified
> public void modifiedEntry(ClientCacheEntryModifiedEvent<K> event) {
> System.out.printf("** Key '%s' was modified\n", event.getKey());
> }
> @ClientCacheEntryRemoved
> public void removedEntry(ClientCacheEntryRemovedEvent<K> event) {
> System.out.printf("** Key '%s' was removed\n", event.getKey());
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 8 months
[JBoss JIRA] (ISPN-5463) ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
by Adrian Nistor (JIRA)
[ https://issues.jboss.org/browse/ISPN-5463?page=com.atlassian.jira.plugin.... ]
Adrian Nistor updated ISPN-5463:
--------------------------------
Fix Version/s: 7.2.2.Final
8.0.0.Alpha1
> ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> --------------------------------------------------------------------------------------------------
>
> Key: ISPN-5463
> URL: https://issues.jboss.org/browse/ISPN-5463
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Querying
> Affects Versions: 7.2.1.Final
> Reporter: Philippe Cuvecle
> Assignee: Adrian Nistor
> Fix For: 7.2.2.Final, 8.0.0.Alpha1
>
>
> I try to use hotrod + protobuf + event notification and get a Class cast exception on Infinispan server side when trying to put an object
> Server side :
> ---------------
> Infinispan 7.2.1 in server mode
> I have declared my proto file in the MBean ProtobufMetadataManager
> Cache config :
> <replicated-cache name="myReplicatedCache" mode="SYNC" start="EAGER">
> <indexing index="ALL" auto-config="true"/>
> </replicated-cache>
> Client side
> -------------
> My cache object is modeled as a POJO with 5 string fields and its proto definition file
> I am able to put and get and even query successfully until I try to register a ClientListener. When doing this, the first put fails with this stacktrace :
> 16:37:36,186 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-5) ISPN000136: Execution error: org.infinispan.commons.CacheListenerException: ISPN000280: Caught exception [java.lang.ClassCastException] while invoking method [public void org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(org.infinispan.notifications.cachelistener.event.CacheEntryEvent)] on listener instance: org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender@3909d917
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:291) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl.invoke(AbstractListenerImpl.java:309) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.doRealInvocation(CacheNotifierImpl.java:1160) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1155) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1132) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryCreated(CacheNotifierImpl.java:290) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.notifyCommitEntry(ClusteringDependentLogic.java:138) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$InvalidationLogic.commitSingleEntry(ClusteringDependentLogic.java:331) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$ReplicationLogic.commitSingleEntry(ClusteringDependentLogic.java:372) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.commitEntry(ClusteringDependentLogic.java:108) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntry(EntryWrappingInterceptor.java:371) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:549) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:348) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:422) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:453) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:195) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:164)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:88) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:324) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:115) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:69) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:236) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:215) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:132) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:50) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:208) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32) [infinispan-server-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
> Caused by: java.lang.ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> at org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(ClientListenerRegistry.scala:183) [infinispan-server-hotrod.jar:7.2.1.Final]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:286) [infinispan-core.jar:7.2.1.Final]
> ... 73 more
> Client side code :
> ----------------------
> ...
> ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
> configurationBuilder.addServer().host(IP_ADDRESS).port(11222).marshaller(new ProtoStreamMarshaller());
> RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configurationBuilder.build());
> EventPrintListener listener = new EventPrintListener();
> SerializationContext srcCtx = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
> srcCtx.registerProtoFiles(FileDescriptorSource.fromResources("/myObject.proto"));
> srcCtx.registerMarshaller(new MyObjectMarshaller());
>
> // Obtain the cache
> RemoteCache<Integer, MyObject> remoteCache = remoteCacheManager.getCache("myReplicatedCache");
> // Add remote listener
> remoteCache.addClientListener(listener); // no issue if this is removed
>
> MyObject o = new MyObject();
> o.setA("XXXX");
> o.setB("YYYY");
> o.setC("ZZZZ");
> o.setD("AAAA");
> o.setE("BBBB");
>
> remoteCache.put(1, o); // server stacktrace
> Listener :
> -----------
> @ClientListener
> public class EventPrintListener<K> {
> @ClientCacheEntryCreated
> public void createdEntry(ClientCacheEntryCreatedEvent<K> event) {
> System.out.printf("** Key '%s' was created\n", event.getKey());
> }
> @ClientCacheEntryModified
> public void modifiedEntry(ClientCacheEntryModifiedEvent<K> event) {
> System.out.printf("** Key '%s' was modified\n", event.getKey());
> }
> @ClientCacheEntryRemoved
> public void removedEntry(ClientCacheEntryRemovedEvent<K> event) {
> System.out.printf("** Key '%s' was removed\n", event.getKey());
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 8 months
[JBoss JIRA] (ISPN-5463) ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
by Adrian Nistor (JIRA)
[ https://issues.jboss.org/browse/ISPN-5463?page=com.atlassian.jira.plugin.... ]
Adrian Nistor updated ISPN-5463:
--------------------------------
Status: Open (was: New)
> ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> --------------------------------------------------------------------------------------------------
>
> Key: ISPN-5463
> URL: https://issues.jboss.org/browse/ISPN-5463
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Querying
> Affects Versions: 7.2.1.Final
> Reporter: Philippe Cuvecle
>
> I try to use hotrod + protobuf + event notification and get a Class cast exception on Infinispan server side when trying to put an object
> Server side :
> ---------------
> Infinispan 7.2.1 in server mode
> I have declared my proto file in the MBean ProtobufMetadataManager
> Cache config :
> <replicated-cache name="myReplicatedCache" mode="SYNC" start="EAGER">
> <indexing index="ALL" auto-config="true"/>
> </replicated-cache>
> Client side
> -------------
> My cache object is modeled as a POJO with 5 string fields and its proto definition file
> I am able to put and get and even query successfully until I try to register a ClientListener. When doing this, the first put fails with this stacktrace :
> 16:37:36,186 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-5) ISPN000136: Execution error: org.infinispan.commons.CacheListenerException: ISPN000280: Caught exception [java.lang.ClassCastException] while invoking method [public void org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(org.infinispan.notifications.cachelistener.event.CacheEntryEvent)] on listener instance: org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender@3909d917
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:291) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl.invoke(AbstractListenerImpl.java:309) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.doRealInvocation(CacheNotifierImpl.java:1160) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1155) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1132) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryCreated(CacheNotifierImpl.java:290) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.notifyCommitEntry(ClusteringDependentLogic.java:138) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$InvalidationLogic.commitSingleEntry(ClusteringDependentLogic.java:331) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$ReplicationLogic.commitSingleEntry(ClusteringDependentLogic.java:372) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.commitEntry(ClusteringDependentLogic.java:108) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntry(EntryWrappingInterceptor.java:371) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:549) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:348) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:422) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:453) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:195) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:164)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:88) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:324) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:115) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:69) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:236) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:215) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:132) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:50) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:208) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32) [infinispan-server-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
> Caused by: java.lang.ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> at org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(ClientListenerRegistry.scala:183) [infinispan-server-hotrod.jar:7.2.1.Final]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:286) [infinispan-core.jar:7.2.1.Final]
> ... 73 more
> Client side code :
> ----------------------
> ...
> ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
> configurationBuilder.addServer().host(IP_ADDRESS).port(11222).marshaller(new ProtoStreamMarshaller());
> RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configurationBuilder.build());
> EventPrintListener listener = new EventPrintListener();
> SerializationContext srcCtx = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
> srcCtx.registerProtoFiles(FileDescriptorSource.fromResources("/myObject.proto"));
> srcCtx.registerMarshaller(new MyObjectMarshaller());
>
> // Obtain the cache
> RemoteCache<Integer, MyObject> remoteCache = remoteCacheManager.getCache("myReplicatedCache");
> // Add remote listener
> remoteCache.addClientListener(listener); // no issue if this is removed
>
> MyObject o = new MyObject();
> o.setA("XXXX");
> o.setB("YYYY");
> o.setC("ZZZZ");
> o.setD("AAAA");
> o.setE("BBBB");
>
> remoteCache.put(1, o); // server stacktrace
> Listener :
> -----------
> @ClientListener
> public class EventPrintListener<K> {
> @ClientCacheEntryCreated
> public void createdEntry(ClientCacheEntryCreatedEvent<K> event) {
> System.out.printf("** Key '%s' was created\n", event.getKey());
> }
> @ClientCacheEntryModified
> public void modifiedEntry(ClientCacheEntryModifiedEvent<K> event) {
> System.out.printf("** Key '%s' was modified\n", event.getKey());
> }
> @ClientCacheEntryRemoved
> public void removedEntry(ClientCacheEntryRemovedEvent<K> event) {
> System.out.printf("** Key '%s' was removed\n", event.getKey());
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 8 months
[JBoss JIRA] (ISPN-5463) ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
by Adrian Nistor (JIRA)
[ https://issues.jboss.org/browse/ISPN-5463?page=com.atlassian.jira.plugin.... ]
Adrian Nistor reassigned ISPN-5463:
-----------------------------------
Assignee: Adrian Nistor
> ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> --------------------------------------------------------------------------------------------------
>
> Key: ISPN-5463
> URL: https://issues.jboss.org/browse/ISPN-5463
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Querying
> Affects Versions: 7.2.1.Final
> Reporter: Philippe Cuvecle
> Assignee: Adrian Nistor
>
> I try to use hotrod + protobuf + event notification and get a Class cast exception on Infinispan server side when trying to put an object
> Server side :
> ---------------
> Infinispan 7.2.1 in server mode
> I have declared my proto file in the MBean ProtobufMetadataManager
> Cache config :
> <replicated-cache name="myReplicatedCache" mode="SYNC" start="EAGER">
> <indexing index="ALL" auto-config="true"/>
> </replicated-cache>
> Client side
> -------------
> My cache object is modeled as a POJO with 5 string fields and its proto definition file
> I am able to put and get and even query successfully until I try to register a ClientListener. When doing this, the first put fails with this stacktrace :
> 16:37:36,186 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-5) ISPN000136: Execution error: org.infinispan.commons.CacheListenerException: ISPN000280: Caught exception [java.lang.ClassCastException] while invoking method [public void org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(org.infinispan.notifications.cachelistener.event.CacheEntryEvent)] on listener instance: org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender@3909d917
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:291) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl.invoke(AbstractListenerImpl.java:309) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.doRealInvocation(CacheNotifierImpl.java:1160) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1155) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1132) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryCreated(CacheNotifierImpl.java:290) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.notifyCommitEntry(ClusteringDependentLogic.java:138) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$InvalidationLogic.commitSingleEntry(ClusteringDependentLogic.java:331) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$ReplicationLogic.commitSingleEntry(ClusteringDependentLogic.java:372) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.commitEntry(ClusteringDependentLogic.java:108) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntry(EntryWrappingInterceptor.java:371) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:549) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:348) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:422) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:453) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:195) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:164)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:88) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:324) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:115) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:69) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:236) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:215) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:132) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:50) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:208) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32) [infinispan-server-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
> Caused by: java.lang.ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> at org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(ClientListenerRegistry.scala:183) [infinispan-server-hotrod.jar:7.2.1.Final]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:286) [infinispan-core.jar:7.2.1.Final]
> ... 73 more
> Client side code :
> ----------------------
> ...
> ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
> configurationBuilder.addServer().host(IP_ADDRESS).port(11222).marshaller(new ProtoStreamMarshaller());
> RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configurationBuilder.build());
> EventPrintListener listener = new EventPrintListener();
> SerializationContext srcCtx = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
> srcCtx.registerProtoFiles(FileDescriptorSource.fromResources("/myObject.proto"));
> srcCtx.registerMarshaller(new MyObjectMarshaller());
>
> // Obtain the cache
> RemoteCache<Integer, MyObject> remoteCache = remoteCacheManager.getCache("myReplicatedCache");
> // Add remote listener
> remoteCache.addClientListener(listener); // no issue if this is removed
>
> MyObject o = new MyObject();
> o.setA("XXXX");
> o.setB("YYYY");
> o.setC("ZZZZ");
> o.setD("AAAA");
> o.setE("BBBB");
>
> remoteCache.put(1, o); // server stacktrace
> Listener :
> -----------
> @ClientListener
> public class EventPrintListener<K> {
> @ClientCacheEntryCreated
> public void createdEntry(ClientCacheEntryCreatedEvent<K> event) {
> System.out.printf("** Key '%s' was created\n", event.getKey());
> }
> @ClientCacheEntryModified
> public void modifiedEntry(ClientCacheEntryModifiedEvent<K> event) {
> System.out.printf("** Key '%s' was modified\n", event.getKey());
> }
> @ClientCacheEntryRemoved
> public void removedEntry(ClientCacheEntryRemovedEvent<K> event) {
> System.out.printf("** Key '%s' was removed\n", event.getKey());
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 8 months
[JBoss JIRA] (ISPN-5463) ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
by Philippe Cuvecle (JIRA)
[ https://issues.jboss.org/browse/ISPN-5463?page=com.atlassian.jira.plugin.... ]
Philippe Cuvecle updated ISPN-5463:
-----------------------------------
Description:
I try to use hotrod + protobuf + event notification and get a Class cast exception on Infinispan server side when trying to put an object
Server side :
---------------
Infinispan 7.2.1 in server mode
I have declared my proto file in the MBean ProtobufMetadataManager
Cache config :
<replicated-cache name="myReplicatedCache" mode="SYNC" start="EAGER">
<indexing index="ALL" auto-config="true"/>
</replicated-cache>
Client side
-------------
My cache object is modeled as a POJO with 5 string fields and its proto definition file
I am able to put and get and even query successfully until I try to register a ClientListener. When doing this, the first put fails with this stacktrace :
16:37:36,186 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-5) ISPN000136: Execution error: org.infinispan.commons.CacheListenerException: ISPN000280: Caught exception [java.lang.ClassCastException] while invoking method [public void org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(org.infinispan.notifications.cachelistener.event.CacheEntryEvent)] on listener instance: org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender@3909d917
at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:291) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl.invoke(AbstractListenerImpl.java:309) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.doRealInvocation(CacheNotifierImpl.java:1160) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1155) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1132) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryCreated(CacheNotifierImpl.java:290) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.notifyCommitEntry(ClusteringDependentLogic.java:138) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$InvalidationLogic.commitSingleEntry(ClusteringDependentLogic.java:331) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$ReplicationLogic.commitSingleEntry(ClusteringDependentLogic.java:372) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.commitEntry(ClusteringDependentLogic.java:108) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntry(EntryWrappingInterceptor.java:371) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:549) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:348) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:422) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:453) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:195) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:164)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:88) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:324) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:115) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:69) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:236) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:215) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:132) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:50) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:208) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45) [infinispan-server-hotrod.jar:7.2.1.Final]
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32) [infinispan-server-core.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
Caused by: java.lang.ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
at org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(ClientListenerRegistry.scala:183) [infinispan-server-hotrod.jar:7.2.1.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:286) [infinispan-core.jar:7.2.1.Final]
... 73 more
Client side code :
----------------------
...
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
configurationBuilder.addServer().host(IP_ADDRESS).port(11222).marshaller(new ProtoStreamMarshaller());
RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configurationBuilder.build());
EventPrintListener listener = new EventPrintListener();
SerializationContext srcCtx = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
srcCtx.registerProtoFiles(FileDescriptorSource.fromResources("/myObject.proto"));
srcCtx.registerMarshaller(new MyObjectMarshaller());
// Obtain the cache
RemoteCache<Integer, MyObject> remoteCache = remoteCacheManager.getCache("myReplicatedCache");
// Add remote listener
remoteCache.addClientListener(listener); // no issue if this is removed
MyObject o = new MyObject();
o.setA("XXXX");
o.setB("YYYY");
o.setC("ZZZZ");
o.setD("AAAA");
o.setE("BBBB");
remoteCache.put(1, o); // server stacktrace
Listener :
-----------
@ClientListener
public class EventPrintListener<K> {
@ClientCacheEntryCreated
public void createdEntry(ClientCacheEntryCreatedEvent<K> event) {
System.out.printf("** Key '%s' was created\n", event.getKey());
}
@ClientCacheEntryModified
public void modifiedEntry(ClientCacheEntryModifiedEvent<K> event) {
System.out.printf("** Key '%s' was modified\n", event.getKey());
}
@ClientCacheEntryRemoved
public void removedEntry(ClientCacheEntryRemovedEvent<K> event) {
System.out.printf("** Key '%s' was removed\n", event.getKey());
}
}
was:
I try to use hotrod + protobuf + event notification and get a Class cast exception on Infinispan server side when trying to put an object
Server side :
Infinispan 7.2.1 in server mode
I have declared my proto file in the MBean ProtobufMetadataManager
Cache config :
<replicated-cache name="myReplicatedCache" mode="SYNC" start="EAGER">
<indexing index="ALL" auto-config="true"/>
</replicated-cache>
Client side
My cache object is modeled as a POJO with 5 string fields and its proto definition file
I am able to put and get and even query successfully until I try to register a ClientListener. When doing this, the first put fails with this stacktrace :
16:37:36,186 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-5) ISPN000136: Execution error: org.infinispan.commons.CacheListenerException: ISPN000280: Caught exception [java.lang.ClassCastException] while invoking method [public void org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(org.infinispan.notifications.cachelistener.event.CacheEntryEvent)] on listener instance: org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender@3909d917
at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:291) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl.invoke(AbstractListenerImpl.java:309) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.doRealInvocation(CacheNotifierImpl.java:1160) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1155) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1132) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryCreated(CacheNotifierImpl.java:290) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.notifyCommitEntry(ClusteringDependentLogic.java:138) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$InvalidationLogic.commitSingleEntry(ClusteringDependentLogic.java:331) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$ReplicationLogic.commitSingleEntry(ClusteringDependentLogic.java:372) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.commitEntry(ClusteringDependentLogic.java:108) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntry(EntryWrappingInterceptor.java:371) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:549) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:348) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:422) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:453) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:195) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:164)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:88) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:324) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:115) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:69) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:236) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:215) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:132) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:50) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:208) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45) [infinispan-server-hotrod.jar:7.2.1.Final]
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32) [infinispan-server-core.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
Caused by: java.lang.ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
at org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(ClientListenerRegistry.scala:183) [infinispan-server-hotrod.jar:7.2.1.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:286) [infinispan-core.jar:7.2.1.Final]
... 73 more
Client side code :
...
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
configurationBuilder.addServer().host(IP_ADDRESS).port(11222).marshaller(new ProtoStreamMarshaller());
RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configurationBuilder.build());
EventPrintListener listener = new EventPrintListener();
SerializationContext srcCtx = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
srcCtx.registerProtoFiles(FileDescriptorSource.fromResources("/myObject.proto"));
srcCtx.registerMarshaller(new MyObjectMarshaller());
// Obtain the cache
RemoteCache<Integer, MyObject> remoteCache = remoteCacheManager.getCache("myReplicatedCache");
// Add remote listener
remoteCache.addClientListener(listener); // no issue if this is removed
MyObject o = new MyObject();
o.setA("XXXX");
o.setB("YYYY");
o.setC("ZZZZ");
o.setD("AAAA");
o.setE("BBBB");
remoteCache.put(1, o); // server stacktrace
Listener :
@ClientListener
public class EventPrintListener<K> {
@ClientCacheEntryCreated
public void createdEntry(ClientCacheEntryCreatedEvent<K> event) {
System.out.printf("** Key '%s' was created\n", event.getKey());
}
@ClientCacheEntryModified
public void modifiedEntry(ClientCacheEntryModifiedEvent<K> event) {
System.out.printf("** Key '%s' was modified\n", event.getKey());
}
@ClientCacheEntryRemoved
public void removedEntry(ClientCacheEntryRemovedEvent<K> event) {
System.out.printf("** Key '%s' was removed\n", event.getKey());
}
}
> ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> --------------------------------------------------------------------------------------------------
>
> Key: ISPN-5463
> URL: https://issues.jboss.org/browse/ISPN-5463
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Querying
> Affects Versions: 7.2.1.Final
> Reporter: Philippe Cuvecle
>
> I try to use hotrod + protobuf + event notification and get a Class cast exception on Infinispan server side when trying to put an object
> Server side :
> ---------------
> Infinispan 7.2.1 in server mode
> I have declared my proto file in the MBean ProtobufMetadataManager
> Cache config :
> <replicated-cache name="myReplicatedCache" mode="SYNC" start="EAGER">
> <indexing index="ALL" auto-config="true"/>
> </replicated-cache>
> Client side
> -------------
> My cache object is modeled as a POJO with 5 string fields and its proto definition file
> I am able to put and get and even query successfully until I try to register a ClientListener. When doing this, the first put fails with this stacktrace :
> 16:37:36,186 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-5) ISPN000136: Execution error: org.infinispan.commons.CacheListenerException: ISPN000280: Caught exception [java.lang.ClassCastException] while invoking method [public void org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(org.infinispan.notifications.cachelistener.event.CacheEntryEvent)] on listener instance: org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender@3909d917
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:291) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl.invoke(AbstractListenerImpl.java:309) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.doRealInvocation(CacheNotifierImpl.java:1160) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1155) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1132) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryCreated(CacheNotifierImpl.java:290) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.notifyCommitEntry(ClusteringDependentLogic.java:138) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$InvalidationLogic.commitSingleEntry(ClusteringDependentLogic.java:331) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$ReplicationLogic.commitSingleEntry(ClusteringDependentLogic.java:372) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.commitEntry(ClusteringDependentLogic.java:108) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntry(EntryWrappingInterceptor.java:371) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:549) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:348) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:422) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:453) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:195) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:164)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:88) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:324) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:115) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:69) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:236) [infinispan-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:215) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:132) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:50) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:208) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32) [infinispan-server-core.jar:7.2.1.Final]
> at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.25.Final.jar:4.0.25.Final]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
> Caused by: java.lang.ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
> at org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(ClientListenerRegistry.scala:183) [infinispan-server-hotrod.jar:7.2.1.Final]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
> at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:286) [infinispan-core.jar:7.2.1.Final]
> ... 73 more
> Client side code :
> ----------------------
> ...
> ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
> configurationBuilder.addServer().host(IP_ADDRESS).port(11222).marshaller(new ProtoStreamMarshaller());
> RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configurationBuilder.build());
> EventPrintListener listener = new EventPrintListener();
> SerializationContext srcCtx = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
> srcCtx.registerProtoFiles(FileDescriptorSource.fromResources("/myObject.proto"));
> srcCtx.registerMarshaller(new MyObjectMarshaller());
>
> // Obtain the cache
> RemoteCache<Integer, MyObject> remoteCache = remoteCacheManager.getCache("myReplicatedCache");
> // Add remote listener
> remoteCache.addClientListener(listener); // no issue if this is removed
>
> MyObject o = new MyObject();
> o.setA("XXXX");
> o.setB("YYYY");
> o.setC("ZZZZ");
> o.setD("AAAA");
> o.setE("BBBB");
>
> remoteCache.put(1, o); // server stacktrace
> Listener :
> -----------
> @ClientListener
> public class EventPrintListener<K> {
> @ClientCacheEntryCreated
> public void createdEntry(ClientCacheEntryCreatedEvent<K> event) {
> System.out.printf("** Key '%s' was created\n", event.getKey());
> }
> @ClientCacheEntryModified
> public void modifiedEntry(ClientCacheEntryModifiedEvent<K> event) {
> System.out.printf("** Key '%s' was modified\n", event.getKey());
> }
> @ClientCacheEntryRemoved
> public void removedEntry(ClientCacheEntryRemovedEvent<K> event) {
> System.out.printf("** Key '%s' was removed\n", event.getKey());
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 8 months
[JBoss JIRA] (ISPN-5463) ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
by Philippe Cuvecle (JIRA)
Philippe Cuvecle created ISPN-5463:
--------------------------------------
Summary: ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
Key: ISPN-5463
URL: https://issues.jboss.org/browse/ISPN-5463
Project: Infinispan
Issue Type: Bug
Components: Remote Querying
Affects Versions: 7.2.1.Final
Reporter: Philippe Cuvecle
I try to use hotrod + protobuf + event notification and get a Class cast exception on Infinispan server side when trying to put an object
Server side :
Infinispan 7.2.1 in server mode
I have declared my proto file in the MBean ProtobufMetadataManager
Cache config :
<replicated-cache name="myReplicatedCache" mode="SYNC" start="EAGER">
<indexing index="ALL" auto-config="true"/>
</replicated-cache>
Client side
My cache object is modeled as a POJO with 5 string fields and its proto definition file
I am able to put and get and even query successfully until I try to register a ClientListener. When doing this, the first put fails with this stacktrace :
16:37:36,186 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-5) ISPN000136: Execution error: org.infinispan.commons.CacheListenerException: ISPN000280: Caught exception [java.lang.ClassCastException] while invoking method [public void org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(org.infinispan.notifications.cachelistener.event.CacheEntryEvent)] on listener instance: org.infinispan.server.hotrod.ClientListenerRegistry$StatelessClientEventSender@3909d917
at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:291) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl.invoke(AbstractListenerImpl.java:309) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.doRealInvocation(CacheNotifierImpl.java:1160) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1155) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1132) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryCreated(CacheNotifierImpl.java:290) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.notifyCommitEntry(ClusteringDependentLogic.java:138) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$InvalidationLogic.commitSingleEntry(ClusteringDependentLogic.java:331) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$ReplicationLogic.commitSingleEntry(ClusteringDependentLogic.java:372) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.commitEntry(ClusteringDependentLogic.java:108) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntry(EntryWrappingInterceptor.java:371) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:549) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:348) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:422) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:453) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:195) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:164)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:88) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:324) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:115) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:69) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:236) [infinispan-core.jar:7.2.1.Final]
at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:215) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:132) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:50) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:208) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:45) [infinispan-server-hotrod.jar:7.2.1.Final]
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32) [infinispan-server-core.jar:7.2.1.Final]
at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:31) [infinispan-server-hotrod.jar:7.2.1.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.25.Final.jar:4.0.25.Final]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
Caused by: java.lang.ClassCastException: org.infinispan.query.remote.indexing.ProtobufValueWrapper cannot be cast to [B
at org.infinispan.server.hotrod.ClientListenerRegistry$BaseClientEventSender.onCacheEvent(ClientListenerRegistry.scala:183) [infinispan-server-hotrod.jar:7.2.1.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
at org.infinispan.notifications.impl.AbstractListenerImpl$ListenerInvocationImpl$1.run(AbstractListenerImpl.java:286) [infinispan-core.jar:7.2.1.Final]
... 73 more
Client side code :
...
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
configurationBuilder.addServer().host(IP_ADDRESS).port(11222).marshaller(new ProtoStreamMarshaller());
RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configurationBuilder.build());
EventPrintListener listener = new EventPrintListener();
SerializationContext srcCtx = ProtoStreamMarshaller.getSerializationContext(remoteCacheManager);
srcCtx.registerProtoFiles(FileDescriptorSource.fromResources("/myObject.proto"));
srcCtx.registerMarshaller(new MyObjectMarshaller());
// Obtain the cache
RemoteCache<Integer, MyObject> remoteCache = remoteCacheManager.getCache("myReplicatedCache");
// Add remote listener
remoteCache.addClientListener(listener); // no issue if this is removed
MyObject o = new MyObject();
o.setA("XXXX");
o.setB("YYYY");
o.setC("ZZZZ");
o.setD("AAAA");
o.setE("BBBB");
remoteCache.put(1, o); // server stacktrace
Listener :
@ClientListener
public class EventPrintListener<K> {
@ClientCacheEntryCreated
public void createdEntry(ClientCacheEntryCreatedEvent<K> event) {
System.out.printf("** Key '%s' was created\n", event.getKey());
}
@ClientCacheEntryModified
public void modifiedEntry(ClientCacheEntryModifiedEvent<K> event) {
System.out.printf("** Key '%s' was modified\n", event.getKey());
}
@ClientCacheEntryRemoved
public void removedEntry(ClientCacheEntryRemovedEvent<K> event) {
System.out.printf("** Key '%s' was removed\n", event.getKey());
}
}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 8 months