title: CustomDeserializer has no default (no arg) constructor
body: <p>I am consuming a REST Api with RestTemplate. The response I'm getting from the API has lots of nested objects. Here's a little snippet as an example:</p>
  
  <pre><code>"formularios": [
    {
      "form_data_id": "123006",
      "form_data": {
        "form_data_id": "123006",
        "form_id": "111",
        "efs": {
          "1": {},
          "2": "{\"t\":\"c\",\"st\":\"m\",\"v\":[{\"id\":\"3675\",\"l\":\"a) Just an example\",\"v\":\"1\"},{\"id\":\"3676\",\"l\":\"b) Another example.\",\"v\":\"2\"}]}"
        }
      }
  </code></pre>
  
  <p>The problem I'm having is that most of the times the "1" actually has content, just like "2", and the jackson just parses it as a String on the object "efs". But sometimes, just like in the code snippet, the API sends it empty, and jackson takes it as an Object, which gives me an error that says something about START_OBJECT (can't remember the exact error, but it's not important for this question).</p>
  
  <p>So I decided to make a custom deserializer so when jackson reads "1", it ignores the empty object and just parses it as a null string.</p>
  
  <p>Here's my custom deserializer:</p>
  
  <pre><code>public class CustomDeserializer extends StdDeserializer&lt;Efs&gt; {
  
   public CustomDeserializer(Class&lt;Efs&gt; t) {
       super(t);
   }
  
   @Override
   public Efs deserialize(JsonParser jp, DeserializationContext dc)
           throws IOException, JsonProcessingException {
  
       String string1 = null;
       String string2 = null;
       JsonToken currentToken = null;
  
       while ((currentToken = jp.nextValue()) != null) {
           if (currentToken.equals(JsonToken.VALUE_STRING)) {
               if (jp.getCurrentName().equals("1")) {
                   string1 = jp.getValueAsString();
               } else {
                   string2 = jp.getValueAsString();
               }
  
           } else {
               if (jp.getCurrentName().equals("2")) {
                   string2 = jp.getValueAsString();
               }
  
           }
       }
       return new Efs(string1, string2);
  
    }
   }
  </code></pre>
  
  <p>And this is the way I'm using it when receiving the response from the API:</p>
  
  <pre><code>    ObjectMapper mapper = new ObjectMapper();  
      SimpleModule mod = new SimpleModule("EfsModule");
      mod.addDeserializer(Efs.class, new CustomDeserializer(Efs.class));
      mapper.registerModule(mod);
  
  
      List&lt;HttpMessageConverter&lt;?&gt;&gt; messageConverters = new ArrayList&lt;&gt;();
      MappingJackson2HttpMessageConverter jsonMessageConverter = new MappingJackson2HttpMessageConverter();
      jsonMessageConverter.setObjectMapper(mapper);
      messageConverters.add(jsonMessageConverter);
  
  
      RestTemplate restTemplate = new RestTemplate();
      restTemplate.setMessageConverters(messageConverters);
  </code></pre>
  
  <p>I'm getting the error:</p>
  
  <pre><code> CustomDeserializer has no default (no arg) constructor
  </code></pre>
  
  <p>But I don't know exactly what I'm doing wrong nor how to solve it. Thanks for the help and apologies for the long question, I wanted to give as much context as possible.</p>