Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA entities returned from WebService
JPA entities returned from WebService [message #531683] Wed, 05 May 2010 18:50
Chris Mathrusse is currently offline Chris MathrusseFriend
Messages: 24
Registered: July 2009
Junior Member
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...
Previous Topic:jdbc connection validation query
Next Topic:Mapping two objects on same table
Goto Forum:
  


Current Time: Sat Apr 27 00:58:38 GMT 2024

Powered by FUDForum. Page generated in 0.02465 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top