I have a class which declares a Joda Time DateTime
field.
However, the value of this isn't set by the unmarhsalling process, instead it's set later in the afterUnmarhsal
method.
Therefore, the field is marked XmlTransient
:
@XmlTransient
private DateTime startTime;
However, when trying to start up, I'm faced with this error:
javax.xml.bind.JAXBException: Exception Description: The class org.joda.time.DateTime$Property requires a zero argument constructor or a specified factory method. Note that non-static inner classes do not have zero argument constructors and are not supported. - with linked exception: [Exception [EclipseLink-50001] (Eclipse Persistence Services - 2.2.0.v20110202-r8913) ...
Why should JAXB care about this class, given that it's clearly transient for marhsalling & unmarshalling purposes?
How can I tell JAXB to ignore this field? I'm aware that I could put a factory method on there, but it seems pointless, given that the factory won't be able to instantiate the value (which is why it's done in afterUnmarshal
)
2.3.2.v20111125-r10461
), and got the same error. FYI - The Maven Page of the wiki is out of date, and only lists releases up to 2.2.0 (which is how I missed it). – Marty Pitt