当我使用SB将Geode客户端缓存创建为->时,我在远程Geode实例上的PDX序列化有问题。
@Configuration
public class GeodeClientConfiguration {
@Bean
ClientCache cache() {
return new ClientCacheFactory()
.setPdxPersistent(true)
.setPdxDiskStore("foo")
.setPdxReadSerialized(true)
.setPdxSerializer(new ReflectionBasedAutoSerializer(false, "foo.EpgProgram"))
.create();
}
@Bean
Region<String, List<EpgProgram>> testRegion(final ClientCache cache) {
return cache.<String, List<EpgProgram>> getRegion("schedule");
}cache.xml看起来像->
<?xml version="1.0" encoding="UTF-8"?>
<client-cache
xmlns="http://geode.apache.org/schema/cache"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://geode.apache.org/schema/cache
http://geode.apache.org/schema/cache/cache-1.0.xsd"
version="1.0">
<pool name="serverPool">
<locator host="localhost" port="10334"/>
</pool>
<region name="schedule" refid="CACHING_PROXY">
<region-attributes pool-name="serverPool"
scope="global" />
</region>
在Gfsh中,我创建了一个区域为
create region --name=/schedule --type=REPLICATE_PERSISTENT在方法测试过程中,向region添加EpgProgram列表时
public List<EpgProgram> getScheduleFromWhatson(String channel, LocalDate broadcastDate, Boolean expand) throws RestClientException, URISyntaxException {
List<EpgProgram> programs = transform(whatsOnServiceInternal.getScheduleFromWhatson(channel, broadcastDate), expand);
schedule.put(channel, programs);
return programs;
}pdx实例似乎是使用我在信息跟踪->中看到的反射生成的
[info 2016/12/09 11:32:33.361 CET <http-nio-8080-exec-1> tid=0xc8] Auto serializer generating type for class dk.dr.epg.core.EpgProgram for fields:
printable: private boolean dk.dr.epg.core.EpgProgram.printable
live: private boolean dk.dr.epg.core.EpgProgram.live
rerun: private boolean dk.dr.epg.core.EpgProgram.rerun但就在那之后,我得到了一个异常->
org.apache.geode.pdx.PdxInitializationException: The PDX metadata must be persistent in a member that has persistent data. See CacheFactory.setPdxPersistent.是否错过了必须设置Pdx persistense的其他地方??
Geode版本:1.0.0-孵化中。
发布于 2016-12-13 04:40:05
您需要将pdx注册表配置为在服务器上永久存在。您可以在gfsh中这样做:
默认配置pdx -- gfsh> -store
我认为您需要在此之后重新启动服务器才能使更改生效。
https://stackoverflow.com/questions/41059201
复制相似问题