【发布时间】:2021-10-12 00:08:15
【问题描述】:
我想生成一组 OGC IndoorGML XML 方案的 JAXB 注释类 (http://schemas.opengis.net/indoorgml/1.0/indoorgmlcore.xsd)
所以我运行xjc -d scr -p [packagename] -nv [path_to_xsd](-nv 抑制输入方案的严格验证)
但运行此命令会导致以下错误消息:
[ERROR] Property "Rows" is already defined. Use <jaxb:property> to resolve this conflict.
line 653 of http://schemas.opengis.net/gml/3.2.1/geometryPrimitives.xsd
[ERROR] The following location is relevant to the above error
line 685 of http://schemas.opengis.net/gml/3.2.1/geometryPrimitives.xsd
[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
line 261 of http://www.w3.org/1999/xlink.xsd
[ERROR] The following location is relevant to the above error
line 246 of http://www.w3.org/1999/xlink.xsd
[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
line 232 of http://www.w3.org/1999/xlink.xsd
[ERROR] The following location is relevant to the above error
line 219 of http://www.w3.org/1999/xlink.xsd
并且没有生成类文件。这很奇怪,因为我希望这些“官方”方案是正确的。
但是,还有什么方法可以生成忽略这些错误的 java 类?
【问题讨论】:
-
看起来您以某种方式加载了相同的架构两次。如果您获取有效模式的两个副本并将它们组合起来,则结果是由于重复而导致的无效模式。但我不太了解 JAXB,无法为您提供帮助。
-
@MichaelKay 好的,谢谢。不,问题似乎确实出在方案中(“行”在一个文件中定义了两次,请参阅上述行)
标签: java xml xsd jaxb gml-geographic-markup-lan