0
我有一個問題,使用Moxy將JSON字符串轉換爲XML對象。 這裏是例外,我是說我這樣做轉換:EclipseLink:「遺漏指示符字段值的類缺失」
Exception [EclipseLink-43] (Eclipse Persistence Services - 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Missing class for indicator field value [TENANT] of type [class java.lang.String].
Descriptor: XMLDescriptor(fr.niji.nates.webservices.macd.ws.COMPONENTTYPE --> [])
at org.eclipse.persistence.exceptions.DescriptorException.missingClassForIndicatorFieldValue(DescriptorException.java:940)
at org.eclipse.persistence.internal.oxm.QNameInheritancePolicy.classFromRow(QNameInheritancePolicy.java:278)
[...]
這裏是類COMPONENTTYPE:
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "COMPONENT_TYPE")
@XmlSeeAlso({
COMPONENTDETAILTYPE.class,
MACDRESULTTYPE.Created.class
})
public class COMPONENTTYPE {
@XmlAttribute(name = "type", required = true)
protected String type;
@XmlAttribute(name = "dbid", required = true)
protected int dbid;
public String getType() {
return type;
}
public void setType(String value) {
this.type = value;
}
public int getDbid() {
return dbid;
}
public void setDbid(int value) {
this.dbid = value;
}
}
這個問題似乎只有在「類型」屬性。
有沒有人有想法? 謝謝,
屬性@type是用於「classIndicatorField」。所以在QNameInheritancePolicy.classFromRow方法中,'lineObject indicator = rowFromDatabase.get(getClassIndicatorField());'返回結果而不是「null」...有沒有解決方案來忽略這個? – user2096168