首页 > 解决方案 > 两个类具有相同的 XML 类型名称……”

问题描述

获取 JAXB 异常,例如“两个类具有相同的 XML 类型名称......”

然而,这些是第 3 方库加上生成的 xml 被另一个应用程序使用,其中没有属性中不同注释的映射。

是否有另一种方法来解决这个问题?

java.lang.RuntimeException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
Hay dos clases que tienen el mismo nombre de tipo XML "status". Utilice @XmlType.name y @XmlType.namespace para asignarles nombres diferentes.
        this problem is related to the following location:
                at com.test.mx.PersonBO$Status
                at public com.test.mx.PersonBO$Status com.test.mx.PersonBO.getPersonStatus()
                at com.test.mx.PersonBO
                at public com.test.mx.PersonBO com.test.mx.ReportHeaderTO.getPersonCreator()
                at com.test.mx.ReportHeaderTO
                at private com.test.mx.ReportHeaderTO com.test.mx.common.QueueXml.header
                at com.test.mx.common.QueueXml
        this problem is related to the following location:
                at com.test.mx.ReportTO$Status
                at public com.test.mx.ReportTO$Status com.test.mx.ReportHeaderTO.getStatus()
                at com.test.mx.ReportHeaderTO
                at private com.test.mx.ReportHeaderTO com.test.mx.common.QueueXml.header
                at com.test.mx.common.QueueXml

标签: javaxmljaxb

解决方案


推荐阅读