试图将aList<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()

知道吗?谢谢!

最佳答案

封送Status有点复杂,因为在twitter4j 3.0中实现StatusJSONImpl的类受到保护。
您需要重写类并使其对您的类可见。
请查看以下示例以获取详细信息。
https://github.com/phstudy/Twitter4j_JAXB_example

关于java - 将twitter4J状态保存到MongoDB会给出“twitter4j.Status是一个接口(interface),而JAXB无法处理接口(interface)”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18490707/

10-13 07:40