Trying to save a List<Status>
to MongoDB (via Morphia), and I get this compile time error:
com.sun.xml.ws.spi.db.DatabindingException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
twitter4j.Status is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at twitter4j.Status
at public java.util.List Model.TwitterJob.getStatuses()
Any idea? Thanks a lot!
It's a little complicated to marshal Status
, because the class StatusJSONImpl
which implements Status
in Twitter4j 3.0 is protected.
You need to override the class and make it visible to your classes.
Please checkout the following example for detail.