How to parse XML with repeated XML tags into a POJO using Jackson?
<p>I am having issues with parsing this XML into a POJO using Jackson. I have read all the previous descriptions on making classes to de-serialise the XML into POJOS but I keep getting either Null pointers or not END of element warnings. I am extremely confused and any help is much appreciated.</p>

<p>The input xml is</p>

<pre><code>                 &lt;row&gt;               
                    &lt;entry align="right" valign="top"&gt;20&lt;/entry&gt;
                    &lt;entry align="right" valign="top"&gt;1A&lt;/entry&gt;
                    &lt;entry valign="top"&gt;SData&lt;/entry&gt;
                    &lt;entry align="center" valign="top"&gt;2&lt;/entry&gt;
                    &lt;entry valign="top"&gt;binary&lt;/entry&gt;
                    &lt;entry valign="top"&gt;Java enterprise&lt;/entry&gt;
                &lt;/row&gt;
</code></pre>

<p>The code I am using is;</p>

<pre><code>static void testSmallXml(){
    String big = null;
    try
    {
        big = readFileToString("other/testXML/NewFile.xml");
    } catch (IOException e)
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    XmlMapper xmlMapper = new XmlMapper();


    String small = big.substring(big.lastIndexOf("&lt;row&gt;"), big.lastIndexOf("&lt;/row&gt;")+8);

        try
        {
            rows in =  xmlMapper.readValue(small, rows.class);
            System.out.println(in.entries[0].value);
        } catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }           

        System.out.println(small);

}
</code></pre>

<p>and my POJO classes are </p>

<pre><code>@JacksonXmlRootElement(localName = "row")
@JsonIgnoreProperties(ignoreUnknown = true)
public static class rows{   
    @JacksonXmlProperty(localName = "entry")
    public entry[] entries;
}

@JacksonXmlRootElement(localName = "entry")
@JsonIgnoreProperties(ignoreUnknown = true)
public static class entry{  

    @JacksonXmlProperty(isAttribute = true)
    private String align;

    @JacksonXmlProperty(isAttribute = true)
    private String valign;

    @JacksonXmlText
    public String value;

}
</code></pre>

<p>I keep getting a Null pointer exception for<br>
    rows["entry"]->Object[][2])</p>