title: Cannot find a deserializer for non-concrete Map type [map type; class com.google.common.collect.ImmutableMap
body: <p>i am using java for back-end, request sent from UI is in <code>JSON</code> format as shown below.</p>
  
  <pre><code>{"name":"Music"}
  </code></pre>
  
  <p>Below is the java code.</p>
  
  <pre><code>@PostMapping(consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE},produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE})
      public Category insertCategory(@RequestBody Category category) {
          // TODO Auto-generated method stub
          System.out.println("entity:" +category.getName());
          CategoryServiceImpl impl = new CategoryServiceImpl();
          Category res = impl.insertCategory(category);
          return res;
      }
  </code></pre>
  
  <p>The response returned to UI should be <code>json</code> so I have used produces with <code>MediaType.APPLICATION_JSON_VALUE</code> as you can see above.</p>
  
  <p>Also request body binds the <code>json</code> data to Category model object , but this is where I am getting the deserialize error (Error log shown below completely).</p>
  
  <p>Category Model is shown below.</p>
  
  <pre><code>public class Category extends Entity {
      private ImmutableMap&lt;String,Category&gt; childCategories;
  
      public ImmutableMap&lt;String, Category&gt; getChildCategories() {
          return childCategories;
      }
      public void setCategories(Map&lt;String,Category&gt; categories) {
          ImmutableMap.Builder&lt;String, Category&gt; builder = new ImmutableMap.Builder&lt;String, Category&gt;();
          builder.putAll(categories);
          childCategories = builder.build();
      }
  }
  </code></pre>
  
  <p>Entity:</p>
  
  <pre><code>public class Entity {
      private String id;
      private String name;
      private String description;
      private String title;
      private String icon;
  }
  //getters and setters method
  </code></pre>
  
  <p>Since the request sent is in <code>json</code> format, I am getting deserialize error and its because of map used in the model. it works if I comment the map part in the category model. </p>
  
  <p>I want to use map instead of list. But how to resolve this deserialize error by keeping map itself in the model</p>
  
  <p>Error log shown below.</p>
  
  <pre><code>org.springframework.web.HttpLogging : 
      Failed to evaluate Jackson deserialization for type [[simple type, class com.hiya.model.Category]]
  
  com.fasterxml.jackson.databind.JsonMappingException:
      Cannot find a deserializer for non-concrete Map type [map type; class com.google.common.collect.ImmutableMap,
      [simple type, class java.lang.String] -&gt; [simple type, class com.hiya.model.Category]]
      at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:306) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:268) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:467) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:473) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.deser.DeserializerCache.hasValueDeserializerFor(DeserializerCache.java:191) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.DeserializationContext.hasValueDeserializerFor(DeserializationContext.java:422) ~[jackson-databind-2.9.7.jar:2.9.7]
      at com.fasterxml.jackson.databind.ObjectMapper.canDeserialize(ObjectMapper.java:2875) ~[jackson-databind-2.9.7.jar:2.9.7]
  </code></pre>
  
  <p>Am I going wrong somewhere ?</p>