Se Song
Se Song

Reputation: 1663

VM JAXB property 'dateOfHire' is of type 'org.joda.time.LocalDate' but is not annotated with @XmlJavaTypeAdapter

On JAXB I have a LocalDate property

@Property(editing = Editing.ENABLED)
@Getter @Setter
private LocalDate dateOfHire;

On my other entity I have added @XmlJavaTypeAdapter(PersistentEntityAdapter.class) they work fine, but LocalDate is org.joda.time.LocalDate so I can't add annotation into it. When I run my VM throw exception:

JAXB view model 'domainapp.modules.employment.dom.employee.EmployeeVM' property 'dateOfHire' is of type 'org.joda.time.LocalDate' but is not annotated with @XmlJavaTypeAdapter. The field/method must be annotated with @XmlJavaTypeAdapter(org.apache.isis.schema.utils.jaxbadapters.XxxAdapter.ForJaxb.class) or equivalent.

Please Help!!!

Upvotes: 0

Views: 52

Answers (1)

Dan Haywood
Dan Haywood

Reputation: 2235

Annotate the field instead ... as per our docs

Upvotes: 1

Related Questions