EclipseLink 2.0.2
Metro
GlassFish v3
I'm having issues returning JPA entities from my WebService. My entities are annotated for EclipseLink and I've defined @XmlID on each of my @Id fields. The issue is that jaxb doesn't let you define those fields as anything other that String. I've worked around the issue by defining my Integer @Id fields as @XmlTransient and placing a method in each entity as follows:
@XmlID
public String getIdString() {
return id != null ? id.toString() : "0";
}
This feels very unnatural but it did resolve the problem. But now I'm faced with the following exception:
java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
org.eclipse.persistence.indirection.WeavedAttributeValueHolderInterface is an interface, and JAXB can't handle interfaces.
So there must be an easier way to get around these issues. I read the Getting Started documentation for Moxy and I defined a jaxb.properties file in the package where my entities are defined but I don't see that it resolved anything for me. So clearly I'm overlooking something.
Any guidance that you can give me here is greatly appreciated.
Thanks...