users@jaxb.java.net

JAXB for JSON: intolerance towards Java Interfaces

From: Arthur Yeo <artyyeo_at_gmail.com>
Date: Wed, 9 Feb 2011 14:33:53 -0800

All,

Met with a run-time error when returning data back from JAX-RS in JSON via
JAXB with Inheritance and Interfaces in between Java objects.

Someone recommended this as a possible solution:
http://jaxb.java.net/guide/Mapping_interfaces.html
but none of the options worked for me.

My workaround now is to create another object and copy the contents across
to this new object. Declare it as @XmlRootElement and it worked as long as
it is a clean simple base object.
This seems quirky to me in terms of perf hit due to the copying of the
object.
If you guys know of a better way, please chime in.

Thanks,
-- 
Arthur Y.