JAXB IllegalAnnotationException with XMLGregorianCalendar

Solution Unverified - Updated -

Environment

  • JBoss Enterprise Application Platform (EAP) 6.x

Issue

We are migrating to EAP 6 from an earlier version of JBoss. When we try to use our generated JAXB objects we are getting the following error:

Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
@XmlAttribute/@XmlValue need to reference a Java type that maps to text in XML.
this problem is related to the following location:
at protected javax.xml.datatype.XMLGregorianCalendar

Resolution

If you change your variable type from javax.xml.datatype.XMLGregorianCalendar to java.util.Date, it should solve the problem.

See here for more details: http://mail-archives.apache.org/mod_mbox/cxf-users/201208.mbox/%3C50411F25.4060508@talend.com%3E

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments