title: Spring JSON Serializer and Deserializer is not getting called
body: <p>I have written custom serializer and deserializer for com.google.common.collect.Table class. But it is not getting called while persisting that object in MongoDB. I am using Spring 4, Spring-MongoDB 1.9 and Jackson 2.8.4. Below are the class and configuration. Could you please let me know what's wrong with this. I want these class to be called while persisting and retrieving from MongoDB.</p>
  
  <pre><code>public class TableSeserializer extends StdSerializer&lt;Table&gt; {
  
      /**
       * 
       */
      private static final long serialVersionUID = 1L;
  
      public TableSeserializer() {
          this(Table.class);
      }
  
      public TableSeserializer(Class&lt;Table&gt; t) {
          super(t);
      }
  
      @SuppressWarnings("unchecked")
      @Override
      public void serialize(Table value, JsonGenerator gen, SerializerProvider provider)
              throws IOException {
          gen.writeStartObject();
          value.rowMap().forEach((i,map) -&gt;{
              try {
                  gen.writeNumber((int)i);
                  ((Map)map).forEach((k,v)-&gt;{
                      try {
                          gen.writeStartObject();
                          Object object = ((Map)map).get(k);
                          if (object instanceof HTMLInputTag) {
                              HTMLInputTag inputTag = (HTMLInputTag) object;
                              gen.writeObjectField(inputTag.getId(),inputTag);
                          }else{
                              gen.writeObjectField(object.toString(),object);
                          }
  
                          gen.writeEndObject();
  
                      } catch (IOException e) {
                          e.printStackTrace();
                      }
                  });
  
              } catch (IOException e) {
                  e.printStackTrace();
              }
          });
          gen.writeEndObject();
      }
  }
  
  public class TableDeserializer extends StdDeserializer&lt;Table&lt;Integer, String, HTMLInputTag&gt;&gt; {
  
      /**
       * 
       */
      private static final long serialVersionUID = 1L;
  
      protected TableDeserializer(Class&lt;?&gt; vc) {
          super(vc);
      }
  
      public TableDeserializer() { 
          this(null); 
      }
  
      @Override
      public Table&lt;Integer, String, HTMLInputTag&gt; deserialize(JsonParser jsonparser, DeserializationContext ctxt)
              throws IOException, JsonProcessingException {
          String data = jsonparser.getText();
          ObjectMapper mapper = new ObjectMapper();
          JsonNode node = mapper.readTree(data);
  
  
          return null;
      }
  
  }
  </code></pre>
  
  <p>Spring configuration</p>
  
  <pre><code>@Override
      public void configureMessageConverters(List&lt;HttpMessageConverter&lt;?&gt;&gt; converters) {
          SimpleModule module = new SimpleModule();
          module.addSerializer(Table.class, new TableSeserializer());
          module.addDeserializer(Table.class, new TableDeserializer());
          Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder().modules(module);
  
          converters.add(jacksonConverter(builder));
      }
  
      @Bean
      MappingJackson2HttpMessageConverter jacksonConverter(Jackson2ObjectMapperBuilder builder) {
          return new MappingJackson2HttpMessageConverter(builder.build());
      }
  </code></pre>
  
  <p>Annotation in class</p>
  
  <pre><code>public class OrganizationAttributeMetaData extends CommonDomainAttributes implements Cloneable, Serializable {
  
      /**
       *
       */
      private static final long serialVersionUID = 1L;
  
      private String attributeName;
      private int orgid;
      private String uniquecode; //3 Character unique code to uniquely identify
  
      @JsonDeserialize(using=TableDeserializer.class)
      @JsonSerialize(using=TableSeserializer.class)
      Table&lt;Integer, String, HTMLInputTag&gt; htmlAttributes = null; //row,identifier and HTML
  
  }
  </code></pre>