- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用从此处下载的官方 XSD 架构:
http://docs.oasis-open.org/ubl/os-UBL-2.0.zip
(路径:xsd/maindoc/UBL-Order-2.0.xsd)
当我使用以下命令通过 XJC 生成 java 类时,我总是在控制台中收到一个我不知道如何处理的错误。
命令:
xjc -d C:\Users\Oscar\Desktop\results -p com.ubl.order C:\Users\Oscar\Desktop\os-UBL-2.0\xsd\maindoc\UBL-Order-2.0.xsd
错误:
parsing a schema...
[WARNING] Simple type "UnitCodeContentType" was not mapped to Enum due to EnumMemberSizeCap limit. Facets count: 1.093, current limit: 256. You can use customization attribute "typesafeEnumMaxMembers" to extend the limit.
line 38 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/CodeList_UnitCode_UNECE_7_04.xsd
[WARNING] Simple type "BinaryObjectMimeCodeContentType" was not mapped to Enum due to EnumMemberSizeCap limit. Facets count: 616, current limit: 256. You can use customization attribute "typesafeEnumMaxMembers" to extend the limit.
line 38 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/CodeList_MIMEMediaTypeCode_IANA_7_04.xsd
[WARNING] Simple type "LanguageCodeContentType" was not mapped to Enum due to EnumMemberSizeCap limit. Facets count: 276, current limit: 256. You can use customization attribute "typesafeEnumMaxMembers" to extend the limit.
line 38 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/CodeList_LanguageCode_ISO_7_04.xsd
compiling a schema...
[ERROR] A class/interface with the same name "com.ubl.order.LocationType" is already in use. Use a class customization to resolve this conflict.
line 9890 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonAggregateComponents-2.0.xsd
[ERROR] (Relevant to above error) another "LocationType" is generated from here.
line 1543 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.TextType" is already in use. Use a class customization to resolve this conflict.
line 2598 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "TextType" is generated from here.
line 1070 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.NameType" is already in use. Use a class customization to resolve this conflict.
line 1718 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "NameType" is generated from here.
line 1105 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.AmountType" is already in use. Use a class customization to resolve this conflict.
line 613 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "AmountType" is generated from here.
line 57 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.MeasureType" is already in use. Use a class customization to resolve this conflict.
line 1668 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "MeasureType" is generated from here.
line 930 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.QuantityType" is already in use. Use a class customization to resolve this conflict.
line 2143 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "QuantityType" is generated from here.
line 1035 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.ChannelCodeType" is already in use. Use a class customization to resolve this conflict.
line 763 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "ChannelCodeType" is generated from here.
line 119 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.DocumentStatusCodeType" is already in use. Use a class customization to resolve this conflict.
line 1103 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "DocumentStatusCodeType" is generated from here.
line 618 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.PackagingTypeCodeType" is already in use. Use a class customization to resolve this conflict.
line 1873 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "PackagingTypeCodeType" is generated from here.
line 1113 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.TransportModeCodeType" is already in use. Use a class customization to resolve this conflict.
line 2753 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "TransportModeCodeType" is generated from here.
line 1708 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.AllowanceChargeReasonCodeType" is already in use. Use a class customization to resolve this conflict.
line 603 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "AllowanceChargeReasonCodeType" is generated from here.
line 19 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.TransportEquipmentTypeCodeType" is already in use. Use a class customization to resolve this conflict.
line 2728 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "TransportEquipmentTypeCodeType" is generated from here.
line 1609 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.PaymentMeansCodeType" is already in use. Use a class customization to resolve this conflict.
line 1978 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "PaymentMeansCodeType" is generated from here.
line 1212 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.CurrencyCodeType" is already in use. Use a class customization to resolve this conflict.
line 913 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "CurrencyCodeType" is generated from here.
line 517 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.LongitudeDirectionCodeType" is already in use. Use a class customization to resolve this conflict.
line 1563 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "LongitudeDirectionCodeType" is generated from here.
line 915 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.SubstitutionStatusCodeType" is already in use. Use a class customization to resolve this conflict.
line 2478 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "SubstitutionStatusCodeType" is generated from here.
line 1411 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.LineStatusCodeType" is already in use. Use a class customization to resolve this conflict.
line 1528 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "LineStatusCodeType" is generated from here.
line 816 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] A class/interface with the same name "com.ubl.order.LatitudeDirectionCodeType" is already in use. Use a class customization to resolve this conflict.
line 1468 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Relevant to above error) another "LatitudeDirectionCodeType" is generated from here.
line 717 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 9890 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonAggregateComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1543 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 2598 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1070 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1718 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1105 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 613 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 57 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1668 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 930 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 2143 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1035 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 763 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 119 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1103 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 618 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1873 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1113 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 2753 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1708 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 603 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 19 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 2728 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1609 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1978 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1212 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 913 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 517 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1563 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 915 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 2478 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1411 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1528 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 816 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1468 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 717 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 166 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonAggregateComponents-2.0.xsd
[ERROR] (Related to above error) This is the other declaration.
line 230 of file:/C:/Users/Oscar/Desktop/os-UBL-2.0/xsd/common/UBL-CommonBasicComponents-2.0.xsd
Failed to produce code.
我尝试的是不使用官方 XSD 并使用 trang.jar 生成我自己的 XSD。结果很好,我得到了生成的 java 类,但是当我使用 JAXB(使用这些类)创建 XML 文档时,命名空间不正确。
所以,我想要的是使用官方 XSD 但修改(可能)使其工作。
如何解决这个问题以获取生成的类?
提前致谢。
最佳答案
试试这个。
xjc UBL-Order-2.0.xsd
关于java - 使用 XJC 的 Java 类的 XML 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10972168/
我使用 XJC 生成一些 Java 类,但生成的 Java 代码包含丑陋的 Javadoc header 。 例子: /** * Java class for XXX complex type.
Maven工程,转移到另一台PC后报错。为什么? [INFO] [jaxb2:generate {execution: default-cli}] [INFO] -------------------
升级到雅加达给我带来了一些问题。。我正在使用以下maven插件:。并且我使用episodal编译(有库)。突然间,我面临着以下问题:。更仔细的检查发现,XJC突然生成了以下字段:。这是它以前没有产生的
我有三个 XSD 文件:a.xsd、b.xsd 和 c.xsd 每个都包含一个名为 MyHeader 的 xs:element 我尝试使用 xjc 从这三个 XSD 文件生成 java 类 生成jav
我正在尝试从 DTD 生成的单个 ~7,000 行 cXML 模式文件生成代码。我已经能够解决一些与 xjc 自定义的冲突,但最后一个让我难过。 我尝试了类和工厂方法自定义,但没有成功。 当我尝试应用
我正在开发使用定制的 XJC 插件。问题是我得到了 [ERROR] compiler was unable to honor this myPlugin:testAnnotation customiz
当我想用 XJC 编译我的 XSD(我不是它的作者)时遇到了麻烦。 具体来说,我得到了错误(实际上还有更多类似的错误): [ERROR] src-resolve: Cannot resolve th
我正在尝试使用 xjc 代码生成工具从 *.xsd 文件包中生成 java 源文件。 这些*.xsd文件中使用的命名空间如下: http://www.domain.com/foo/bar.x htt
我正在使用 JAXB 从 xsd 模式创建类。 有没有办法标记单个复杂类型,以便将它们发送到不同的目标包,而不是将它们全部发送到同一个包? 我需要这个的原因是很多生成的 java 类将被来自不同来源的
我有一个导入 b.xsd 的模式 a.xsd。我在架构 a.xsd 中有如下条目: 我需要使用 jar(公共(public) sdk)中的模式 b.xsd。所以我使用目录文件如下 SYSTEM "b
我们计划使用 JAXB 将 xml 映射到对象。我们的要求是,我们将只处理文档的一部分(稍大),因此我们只想将该部分(片段)转换为对象。因此,我们不想为 xsd 中的所有元素创建类。 如何让 xjc
您好,我正在尝试使用 xjc 命令从 .xsd 文件生成 java 对象。 xsd 文件很大,下面可以看到其中的一部分。当我在以下模式上运行 xjc 时,我得到 3 个类 UpsBas、MsgHdr
我有一个xsd,如下 ..... ..... ......
我们计划使用 JAXB 将 xml 映射到对象。我们的要求是我们将只处理文档的一部分(稍大),因此我们只想将该部分(片段)转换为对象。因此,我们不想为 xsd 中的所有元素创建类。 我们如何让xjc在
这个问题与JAXB2 type restriction not working?有关.我想扩展 XJC 以支持类型限制。它就像覆盖父类(super class)的字段定义一样简单。 有什么办法可以正确
我想从我的 Java 项目调用 ISAN Restful API,所以我尝试使用 maven-jaxb2-plugin 从 xsd 文件生成 java bean。这是 xsds: http://www
如果我有一个如下的架构:
我使用 JAXB 获得了这个 API,可以方便地使用对象模型,这些模型是由 XJC(XML-to-Java)编译器通过命名引用从 XML 模式生成的。它抽象了 JAXB 上下文的创建,并通过各种背景魔
以下模式应该生成两个原始 int Value 中的字段类,而是生成一个原始 int为 元素 和 java.lang.Integer为 属性 .
这些天我花了一些时间在 JAXB 上将 XSD 转换为 Java 类,反之亦然。这是一个非常适合初学者的教程,http://www.journaldev.com/1312/how-to-generat
我是一名优秀的程序员,十分优秀!