0

当我的 Web 应用程序查询 Hazelcast 缓存以获取数据时,我遇到了一个问题,HazelcastSerializationException 被抛出。我们正在使用 hazelcast-all-3.6.6.jar。

以下是从服务器日志收集的相同堆栈跟踪 -

java.util.concurrent.ExecutionException: com.hazelcast.nio.serialization.HazelcastSerializationException: com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory@5e5caba is not be able to create an instance for id: 100 on
factoryId: -32
        at com.hazelcast.spi.impl.operationservice.impl.InvocationFuture.resolveApplicationResponseOrThrowException(InvocationFuture.java:360) ~[hazelcast-all-3.6.6.jar!/:3.6.6]
        at com.hazelcast.spi.impl.operationservice.impl.InvocationFuture.get(InvocationFuture.java:225) ~[hazelcast-all-3.6.6.jar!/:3.6.6]
        at com.hazelcast.spi.impl.operationservice.impl.InvocationFuture.get(InvocationFuture.java:204) ~[hazelcast-all-3.6.6.jar!/:3.6.6]
        at com.hazelcast.map.impl.query.MapQueryEngineImpl.addResultsOfPagingPredicate(MapQueryEngineImpl.java:503) ~[hazelcast-all-3.6.6.jar!/:3.6.6]
        at com.hazelcast.map.impl.query.MapQueryEngineImpl.queryAllPartitionsWithPagingPredicate(MapQueryEngineImpl.java:388) ~[hazelcast-all-3.6.6.jar!/:3.6.6]
        at com.hazelcast.map.impl.proxy.MapProxyImpl.values(MapProxyImpl.java:635) [hazelcast-all-3.6.6.jar!/:3.6.6]

此异常在 Hazelcast 类中,在获取 QueryResultRow 后,它无法进行序列化。以下是完全失败的相同代码片段:

QueryResultRow row = (QueryResultRow)i$1.next();
Object key = this.toObject(row.getKey());
Object value = this.toObject(row.getValue());

以下是 toObject() 方法的实现:

protected Object toObject(Object obj) {
   return this.serializationService.toObject(obj);
}
4

0 回答 0