尝试保存List<Status>
到 MongoDB(通过 Morphia),我得到这个编译时错误:
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()
有什么想法吗?非常感谢!
最佳答案
编码(marshal) Status
有点复杂,因为在 Twitter4j 3.0 中实现 Status
的类 StatusJSONImpl
受到保护。
您需要重写该类并使其对您的类可见。
请查看以下示例以了解详细信息。
关于java - 将 twitter4J 状态保存到 MongoDB 会给出 "twitter4j.Status is an interface, and JAXB can' t 句柄接口(interface)”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18490707/