spring-xdgemfiregeode

Gemfire CacheListenerAdapter implementation ClassNotFoundException: org.apache.geode.pdx.internal.PdxType


I'm getting the following error when I tried to implement CacheListenerAdapter from gemfire.

java.lang.ClassNotFoundException: org.apache.geode.pdx.internal.PdxType

I am using the following code for getting the cache values from gemfire.

import com.gemstone.gemfire.cache.Declarable; import com.gemstone.gemfire.cache.EntryEvent; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.pdx.internal.PdxInstanceImpl;

@Override public void afterUpdate(EntryEvent<K, V> event) { addToQueue((PdxInstanceImpl) event.getNewValue()); }

and I'm reading the price using the following code in addToQueue function

Double price = Double.parseDouble(instance.readField("Price").toString());

Please note that I copied this code from another project and I'm new to gemfire. I use the above code to plot data in a window.


Solution

  • The client needs to be running v8.2.2 or later. Code to translate the org.apache.geode package names to com.gemstone.gemfire was added in that release.