4 Replies Latest reply: Jan 27, 2013 6:21 PM by robvarga RSS

    implement PofSerializer, serialize/deserialize not invoked


      I have an object of a certain type that I want to put in coherence and a serializer for this type which implements PofSerializer. When I put/get the object to/from coherence, I expect serialize/deserialize methods to be called. But I have breakpoints in the serializer class and I can see that these overridden methods are not invoked. Can you help me with that? I will put the classes and configurations here:
      public class Item extends CacheItem {
           private String guid;
           private String cvc;
           public String getGuid() {
                return guid;
           public void setGuid(String guid) {
                this.guid = guid;
           public String getCvc() {
                return cvc;
           public void setCvc(String cvc) {
                this.cvc = cvc;
      The serializer:
      public class CacheItemSerializer implements PofSerializer {
           public Object deserialize(PofReader reader) throws IOException {
                Item item = new CardCacheItem();
                return item;
           public void serialize(PofWriter writer, Object o) throws IOException {
                Item item = (Item) o;
                writer.writeString(0, item.getCvc());
                writer.writeString(0, item.getGuid());
                writer.writeInt(2, item.getAcc());
                writer.writeDouble(3, item.getAm());
      In these two methods above I have breakpoints and they are not invoked.

      The pof-config.xml file:
            <!-- User types must be above 1000 -->
      I initialize the cache like this:
      namedCache = CacheFactory.getCache(cacheName);
      And then call put/get on the namedCache object.

      I have the following arguments set:
      And in the console I see that it loads the pof file.

      That's about all the configuration I make. Am I missing something?

      Edited by: user11200171 on Jan 25, 2013 1:03 PM