两个类具有相同的XML类型名称“ transactionType”。使用@ XmlType.name和@ XmlType.namespace为它们分配不同的名称

时间:2019-04-26 06:27:09

标签: jaxb

我正在尝试使用JAXB从Java对象生成XML,其中Java对象外部对象由我的对象包装,并且我反复地使不同对象的错误不断出现。

我知道两个类的名称相同,但是两个类位于不同的程序包中。我不能更改外部类。在stacktrace中,包external.model的类不是由我创建的,我只有它们的类文件,因此无法对其进行修改。

反正我可以通过JAXB中的某些设置来解决它吗?

Two classes have the same XML type name "transactionType". Use @XmlType.name and @XmlType.namespace to assign different names to them.
    this problem is related to the following location:
        at external.model.transaction.Transaction$TransactionType
        at public external.model.transaction.Transaction$TransactionType external.model.transaction.TransactionAttr.getTransactionType()
        at external.model.transaction.TransactionAttr
        at public java.util.Map external.model.transaction.Transaction.getEnrichedAttrMap()
        at external.model.transaction.Transaction
        at external.model.transaction.SwapReset
        at private external.model.transaction.SwapReset internal.model.transformation.StsTxn.swapReset
        at internal.model.transformation.StsTxn
        at private java.util.List internal.model.transformation.Sts.stsTransactions
        at internal.model.transformation.Sts
    this problem is related to the following location:
        at internal.constants.TransactionType
        at private internal.constants.TransactionType internal.model.transformation.StsTxn.transactionType
        at internal.model.transformation.StsTxn
        at private java.util.List internal.model.transformation.Sts.stsTransactions
        at internal.model.transformation.Sts

0 个答案:

没有答案