Q:

XML dateTime unmarshalling to NULL

I have the following xml element:
    <SchedDate>
        <dateTime>2014-07-09T00:00:00-05:00</dateTime>
    </SchedDate>

And I have the following annotation in my code:
     /**
     * @return the schedDate
     */
    @XmlElement(name = "SchedDate")
    public Date getSchedDate() {
        return schedDate;
    }

When I unmarshall this xml the schedDate attribute is NULL. All other fields from the xml are unmarshalled properly.
Any idea why this might be happening?

A:

Your XML document expects the date to be an element called dateTime, but you have mapped it to an element called SchedDate with the @XmlElement annotation.
Your XML Document Has
<dateTime>2014-07-09T00:00:00-05:00</dateTime>

You Have Mapped To
<SchedDate>2014-07-09T00:00:00-05:00</SchedDate>

