com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "user_activity"
<p>My XML looks like</p>

<pre><code>&lt;IDSentrieServiceResponse&gt;
    &lt;session_id&gt;session_number&lt;/session_id&gt;
    &lt;service name="IDSentrieUser" version="1.1"&gt;
        &lt;action id="IPIDActivityGet"&gt;
            &lt;status&gt;0000&lt;/status&gt;
            &lt;status_msg&gt;optional msg&lt;/status_msg&gt;
            &lt;user_activity_list&gt;
                &lt;username&gt;john&lt;/username&gt;
                &lt;user_activity&gt;
                    &lt;time_start&gt;GMT Time&lt;/time_start&gt;
                    &lt;time_end&gt;GMT Time&lt;/time_end&gt;
                    &lt;user_hostname&gt;John.a10networks.com&lt;/user_hostname&gt;
                    &lt;server_ip&gt;192.168.3.249&lt;/server_ip&gt;
                    &lt;server_hostname&gt;dcsrvr.a10networks.com&lt;/server_hostname&gt;
                    &lt;domain_name&gt;a10.net&lt;/domain_name&gt;
                    &lt;dc_name&gt;dc-server-name&lt;/dc_name&gt;
                &lt;/user_activity&gt;
            &lt;/user_activity_list&gt;
        &lt;/action&gt;
    &lt;/service&gt;
&lt;/IDSentrieServiceResponse&gt;
</code></pre>

<p>I am using <a href="https://github.com/FasterXML/jackson-dataformat-xml" rel="nofollow">fasterxml-databind</a> to put this into Java Object. I have bunch of DTOs but the place it fails to create object is in  </p>

<pre><code>public class UserActivityList {

  @JacksonXmlProperty(localName = "username")
  private String userName;

  @JacksonXmlElementWrapper(useWrapping=false, localName = "user_activity")
  private List&lt;UserActivity&gt; userActivity;

  public void setUserActivity(List&lt;UserActivity&gt; userActivity) {
    this.userActivity = userActivity;
  }

  @Override
  public String toString() {
    return "UserActivityList{" +
        "userName='" + userName + '\'' +
        ", userActivity=" + userActivity +
        '}';
  }
}
</code></pre>

<p>where <code>UserActivity</code> looks like  </p>

<pre><code>public class UserActivity {

  @JacksonXmlProperty(localName = "time_start")
  private String timeStart;

  @JacksonXmlProperty(localName = "time_end")
  private String timeEnd;

  @JacksonXmlProperty(localName = "user_hostname")
  private String userHostName;

  @JacksonXmlProperty(localName = "server_ip")
  private String serverIp;

  @JacksonXmlProperty(localName = "server_hostname")
  private String serverHostName;

  @JacksonXmlProperty(localName = "domain_name")
  private String domainName;

  @JacksonXmlProperty(localName = "dc_name")
  private String dcName;

  @Override
  public String toString() {
    return "UserActivity{" +
        "timeStart='" + timeStart + '\'' +
        ", timeEnd='" + timeEnd + '\'' +
        ", userHostName='" + userHostName + '\'' +
        ", serverIp='" + serverIp + '\'' +
        ", serverHostName='" + serverHostName + '\'' +
        ", domainName='" + domainName + '\'' +
        ", dcName='" + dcName + '\'' +
        '}';
  }
}
</code></pre>

<p>the way I use it to create Object is  </p>

<pre><code>final String responseBody = response.readEntity(String.class);
final ObjectMapper xmlMapper = new XmlMapper();

try {
  final StealthWatchResponse stealthWatchResponse = xmlMapper.readValue(responseBody, StealthWatchResponse.class);
} catch (final IOException e) {
  LOGGER.error("Error in parsing response from Stealthwatch: {}", e);
}
</code></pre>

<p>When I run this, I get  </p>

<pre><code>550  [main] ERROR c.e.tenant.internal.StealthWatch - Error in parsing response from Stealthwatch: {}
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "user_activity" (class com.project.tenant.internal.response.UserActivityList), not marked as ignorable (2 known properties: "userActivity", "username"])
 at [Source: java.io.StringReader@3059cbc; line: 10, column: 33] (through reference chain: com.project.tenant.internal.response.StealthWatchResponse["service"]-&gt;com.project.tenant.internal.response.Service["action"]-&gt;com.project.tenant.internal.response.Action["user_activity_list"]-&gt;com.project.tenant.internal.response.UserActivityList["user_activity"])
    at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:839) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1045) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1352) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1330) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:264) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserialize(WrapperHandlingDeserializer.java:120) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:520) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:101) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:258) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:520) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:101) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:258) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:520) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:101) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:258) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3736) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2726) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at com.project.tenant.internal.StealthWatch.getUserActivities(StealthWatch.java:36) ~[project-tenant-0.1-SNAPSHOT.jar:na]
    at FetchUserActivity.run(FetchUserActivity.java:34) [project-tenant-0.1-SNAPSHOT.jar:na]
    at FetchUserActivity.main(FetchUserActivity.java:20) [project-tenant-0.1-SNAPSHOT.jar:na]
</code></pre>

<p>What is wrong here?</p>