无法查询一致性,获取错误:pofextractor必须与pof编码的二进制条目一起使用;配置的序列化程序不是pofcontext

zbq4xfa0  于 2021-06-29  发布在  Java
关注(0)|答案(0)|浏览(165)

尝试从oracle一致性群集筛选数据时出现以下错误:

Exception in thread "main" Portable(com.tangosol.util.WrapperException): (Wrapped: Failed request execution for PartitionedCacheService service on Member PofExtractor must be used with POF-encoded Binary entries; the configured Serializer is not a PofContext
at com.tangosol.util.Base.ensureRuntimeException(Base.java:250)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.tagException(Grid.CDB:61)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onQueryRequest(PartitionedCache.CDB:50)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$QueryRequest.run(PartitionedCache.CDB:1)
at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:1)

我正在尝试运行以下代码:

@SuppressWarnings("rawtypes") 
  public static void getRiskTradeByApplyingOnlyOneFilterBenchmark(NamedCache riskTradeReadCache) throws Exception {
        ValueExtractor valueExtractor = new PofExtractor(null, 10);
        Filter filter = new EqualsFilter(valueExtractor, "USD");
        Set allRiskTradesWhereCurrencyIsUsd = riskTradeReadCache.keySet(filter);
        for (Object key : allRiskTradesWhereCurrencyIsUsd) {
            final Object o = riskTradeReadCache.get(key);
        }
    }

下面是自定义的pof配置文件

<user-type-list>
    <!-- include all "standard" Coherence POF user types -->
    <include>coherence-pof-config.xml</include>
    <user-type>
        <type-id>1165</type-id>
        <class-name>com.coherence.poc.domain.RiskTrade</class-name>
        <serializer>
            <class-name>com.coherence.poc.serializer.RiskTradeSerializer</class-name>
        </serializer>
    </user-type>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题