title: No String-argument constructor/factory method to deserialize from String value ('')
body: <p>I'm running into a json parsing issue when using the <code>ObjectMapper</code> class from the <code>com.fasterxml.jackson.databind</code> package, and the error that I'm getting is:</p>
  
  <pre><code>com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.graybar.utilities.ups.beans.Address: no String-argument constructor/factory method to deserialize from String value ('')
  </code></pre>
  
  <p>The web application where this problem is occurring is a Spring MVC application using an AngularJS front end, but I can duplicate the issue with a much smaller, all java program. Here are my beans:</p>
  
  <p>Shipment.java</p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  public class Shipment {
      @JsonProperty("Activity")
      private ArrayList&lt;Activity&gt; activity;
      public ArrayList&lt;Activity&gt; getActivity() {
          return activity;
      }
      public void setActivity(ArrayList&lt;Activity&gt; activity) {
          this.activity = activity;
      }
  }
  </code></pre>
  
  <p>Activity.java</p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  public class Activity {
      @JsonProperty("ActivityLocation")
      private ArrayList&lt;ActivityLocation&gt; activityLocation;
      public ArrayList&lt;ActivityLocation&gt; getActivityLocation() {
          return activityLocation;
      }
      public void setActivityLocation(ArrayList&lt;ActivityLocation&gt; activityLocation) {
          this.activityLocation = activityLocation;
      }
  }
  </code></pre>
  
  <p>ActivityLocation.java</p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  public class ActivityLocation {
      @JsonProperty("Address")
      private Address address;
      public Address getAddress() {
          return address;
      }
      public void setAddress(Address address) {
          this.address = address;
      }
  }
  </code></pre>
  
  <p>Address.java</p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  public class Address {
      @JsonProperty("City")
      private String city;
      @JsonProperty("StateProvinceCode")
      private String stateProvinceCode;
      @JsonProperty("CountryCode")
      private String countryCode;
      public String getCity() {
          return city;
      }
      public void setCity(String city) {
          this.city = city;
      }
      public String getCountryCode() {
          return countryCode;
      }
      public void setCountryCode(String countryCode) {
          this.countryCode = countryCode;
      }
      public String getStateProvinceCode() {
          return stateProvinceCode;
      }
      public void setStateProvinceCode(String stateProvinceCode) {
          this.stateProvinceCode = stateProvinceCode;
      }
  }
  </code></pre>
  
  <p>Here is the code where I can properly map the json:</p>
  
  <pre><code>public static void main(String[] args) {
      String jsonMessage = "" +
          "{" + 
          "   \"Activity\": [{ " +
          "       \"ActivityLocation\": { " +
          "           \"Address\": { " +
          "               \"City\": \"Hana\", " +
          "               \"StateProvinceCode\": \"Hi\", " +
          "               \"CountryCode\": \"US\" " +
          "           } " +
          "       } " +
          "   }, " +
          "   { " +
          "       \"ActivityLocation\": { " +
          "           \"Address\": { " +
          "               \"City\": \"Honolulu\", " +
          "               \"StateProvinceCode\": \"Hi\", " +
          "               \"CountryCode\": \"US\" " +
          "           } " +
          "       } " +
          "   }] " +
      "} ";
  
      try {
          ObjectMapper mapper = new ObjectMapper();
          mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
  
          Shipment shipment = mapper.readValue(jsonMessage, Shipment.class);
          System.out.println("shipment.toString = " + shipment.toString());
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>When adjusting the data in the <code>jsonMessage</code> var is when I run into the error that I mentioned above:</p>
  
  <pre><code>    "{" + 
      "   \"Activity\": [{ " +
      "       \"ActivityLocation\": { " +
      "           \"Address\": { " +
      "               \"City\": \"Hana\", " +
      "               \"StateProvinceCode\": \"Hi\", " +
      "               \"CountryCode\": \"US\" " +
      "           } " +
      "       } " +
      "   }, " +
      "   { " +
      "       \"ActivityLocation\": { " +
      "           \"Address\": \"\" " +
      "           } " +
      "       } " +
      "   }] " +
      "} ";
  </code></pre>
  
  <p>So, the problem happens when changing the json from this:</p>
  
  <pre><code>{
      "ActivityLocation": { 
          "Address": {
              "City": "Honolulu", 
              "StateProvinceCode": "Hi", 
              "CountryCode": "US"
          }
      }
  }]
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>{
  "ActivityLocation": {
       "Address": ""
      }
  }
  </code></pre>
  
  <p>Instead of sending values for my <code>Address</code> bean, I'm getting just an empty string. Unfortunately, I'm receiving my data from a third party and have no control over the data I receive. </p>
  
  <p>Is there an annotation that needs to be added to be able to handle this?</p>