Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top