Hazelcast 供应商和聚合给出并发执行异常

Hazelcast Supplier and Aggregation gives Concurrent Execution Exception

我正在尝试获取一组存储在 Hazelcast 地图中的对象字段的不同值。 这行java代码:

instructions.aggregate(Supplier.all(value -> value.getWorkArea()), Aggregations.distinctValues());

具有以下堆栈跟踪:

java.util.concurrent.ExecutionException: com.hazelcast.nio.serialization.HazelcastSerializationException: java.lang.ClassNotFoundException: com.example.instruction.repository.HazelcastInstructionRepository$GeneratedEvaluationClass
com.hazelcast.nio.serialization.HazelcastSerializationException: java.lang.ClassNotFoundException: com.example.instruction.repository.HazelcastInstructionRepository$GeneratedEvaluationClass
java.lang.ClassNotFoundException: com.example.instruction.repository.HazelcastInstructionRepository$GeneratedEvaluationClass

如果我尝试这条线:

instructions.aggregate(Supplier.all()), Aggregations.distinctValues());

或:

instructions.aggregate(Supplier.fromPredicate(Predicates.and(Predicates.equal("type", "someType"), 等于("groupId",无效的), Predicates.equal("workArea", "someWorkArea"))), Aggregations.distinctValues());

它只是工作...当我引用对象的字段时,它似乎有问题。 (我也用对象的其他字段尝试过,并返回相同的错误)

这是我本地环境中的 运行,我确信这些对象已正确放置在 Hazelcast 地图中,因为其他 aggregations/predicates 正在工作。

你知道我做错了什么吗?

非常感谢!

已编辑:所以问题是闭包。它并非在所有节点上都可用。仅在调用节点上。

还有。此功能已弃用。请改用快速聚合。 http://docs.hazelcast.org/docs/latest/manual/html-single/#fast-aggregations