Geode:Serialization Exception&无法在服务器

时间:2017-10-26 14:45:56

标签: geode

我让客户端工作,看起来一切都很好。我可以保存对象并从客户端返回对象。

但是,如果我尝试使用gfsh或数据浏览器来查看数据,我在gfsh上得到了这个例外

Message : Could not create an instance of a class com.room.backend.soa.spring.cache.geode.test.domain.Book
Result  : false

和数据浏览器

javalangException- Query could not be executed due to - orgapachegeodepdxPdxSerializationException- Could not create an instance of a class comroombackendsoaspringcachegeodetestdomainBook

我的代码就像这样

    ClientCacheFactoryBean gemfireCache = new ClientCacheFactoryBean();
    gemfireCache.setClose(true);
    gemfireCache.setProperties(gemfireProperties);
    gemfireCache.setPdxSerializer(pdxSerializer);

pdxSerializer是

    ReflectionBasedAutoSerializer serializer =
            new ReflectionBasedAutoSerializer(
                    "com.room.backend.soa.spring.cache.geode.test.domain.*",
                    "com.room.backend.soa.spring.cache.geode.test.domain.Book",
                    "com.room.backend.soa.spring.cache.geode.test.domain.Book#identity=id.*",
                    "com.room.backend.soa.spring.cache.geode.test.domain.#identity=id.*"

                    );

1 个答案:

答案 0 :(得分:2)

您需要运行gfsh>configure pdx --read-serialized=true命令。这应该在启动定位器之后但在启动服务器之前完成。有关详细信息,请参阅this docs page