Search code examples
isis

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!!!


Solution

  • Annotate the field instead ... as per our docs