有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java无法查询一致性,获取错误:PofExtractor必须与POFencoded二进制项一起使用;配置的序列化程序不是PofContext

我在尝试从oracle coherence cluster筛选数据时遇到以下错误:

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>

共 (0) 个答案