문제

I am trying to put an object as a key inside the Gemfire region.

TestClass keyObject = new TestClass();
region.put(keyObject, "value");

It fails with below error -

com.gemstone.gemfire.cache.client.ServerOperationException: com.gemstone.gemfire.pdx.PdxSerializationException: Could not create an instance of a class 'TestClass'

Please suggest what needs to be implemented in the object that needs to be used as a key while storing in gemfire cache region.

P.S. I have set the autoserialization property of gemfire to be true and i am overriding equals and hashcode in my TestClass and it is having a default empty constructor.

도움이 되었습니까?

해결책

Typically this error would occur if the server is unable to find and load the class in question. The class TestClass has to be added to the cache server's classpath.

Sorry if the answer is too late for you--hopefully it will help others with the same problem.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top