According to https://gist.github.com/VineetReynolds/5108580 , the JAXB Spec requires that the element annotated with @XmlID be String . MOXy was not executed in versions 2.5.x.
However, with version 2.6.0 it is no longer supported.
[Exception [EclipseLink-50016] (Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.persistence.exceptions.JAXBException Exception Description: Property [id] has an XmlID annotation but its type is not String.]**strong text**
Is this the desired behavior or unwanted regression?
What is the correct way to avoid such an error when porting with MOXy 2.5.x?
Use @XmlJavaTypeAdapter as described in this post Marshaling a long primitive type using JAXB , which also affects how the object itself (and its identifier) ββis serialized to JSON (for example, an id field of type Long becomes a json string?
source share