Java オブジェクトをマーシャリングしたいのですが、javax.xml.bind.JAXBContext が例外をスローします。
List<Class> list = new ArrayList<Class>();
list.add(obj.getClass());
list.add(ObjectFactory.getClass());
JAXBContext.newInstance(list); //this line throws exception
わかりました;
ex = (com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException) com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
There's no ObjectFactory with an @XmlElementDecl for the element {http://www.xbrl.org/2003/linkbase}footnoteLink.
編集:これはエラーを与えるコードです。このコードには何か問題があるに違いないと思います。
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"schemaRef",
"linkbaseRef",
"roleRef",
"arcroleRef",
"itemOrTupleOrContext"
})
@XmlRootElement(name = "xbrl")
public class Xbrl {
@XmlElement(namespace = "http://www.xbrl.org/2003/linkbase", required = true)
protected List<SimpleType> schemaRef;
@XmlElement(namespace = "http://www.xbrl.org/2003/linkbase")
protected List<LinkbaseRef> linkbaseRef;
@XmlElement(namespace = "http://www.xbrl.org/2003/linkbase")
protected List<RoleRef> roleRef;
@XmlElement(namespace = "http://www.xbrl.org/2003/linkbase")
protected List<ArcroleRef> arcroleRef;
@XmlElementRefs({
@XmlElementRef(name = "tuple", namespace = "http://www.xbrl.org/2003/instance", type = JAXBElement.class, required = false),
@XmlElementRef(name = "footnoteLink", namespace = "http://www.xbrl.org/2003/linkbase", type = JAXBElement.class, required = false),
@XmlElementRef(name = "item", namespace = "http://www.xbrl.org/2003/instance", type = JAXBElement.class, required = false),
@XmlElementRef(name = "unit", namespace = "http://www.xbrl.org/2003/instance", type = Unit.class, required = false),
@XmlElementRef(name = "context", namespace = "http://www.xbrl.org/2003/instance", type = Context.class, required = false)
})
protected List<Object> itemOrTupleOrContext; //this line
....
}