如何解决JAXB无法为SOATest xsd模式定义生成类
以下是XSD架构,该架构定义了由SOATest工具生成的报告,我正尝试通过JAXB运行该报告以生成用于解析xml报告的Java类,但出现了一些错误,例如: [错误]具有相同名称“ com.org.parser.model.soatest.ErrorList”的类/接口已在使用中。使用类自定义解决此冲突。 (这是第1937行)
后跟: [错误](与上述错误相关)从此处生成另一个“错误列表”。 第1932行...
其他的是“ Thr”,“ TestCase”,但仅跟随重复的错误,例如: [ERROR](与上述错误相关)这是另一个声明。 1329行
我使用了一个命令:
“%java_home%\ bin \ xjc” -p com.org.parser.model.soatest report.xsd
有问题的XSD架构的相关部分(我们被禁止发布/上传完整文件,对于SO问题正文限制,该文件太大: 1937行:
<xs:element name="ErrorList">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Error">
<xs:complexType>
<xs:attribute name="val"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
第1932行:
<xs:complexType name="ErrorList">
<xs:sequence>
<xs:element ref="ErrorList"/>
</xs:sequence>
</xs:complexType>
第1320行,后接1329:
<xs:complexType name="Thr">
<xs:sequence>
<xs:element ref="Thr">
<xs:annotation>
<xs:documentation>throwable/exception associated with this violation</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="Thr">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="ThrPart"/>
</xs:sequence>
<xs:attributeGroup ref="attlist.Thr"/>
</xs:complexType>
</xs:element>
第1376行,后接1381:
<xs:complexType name="TestCase">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="TestCase"/>
</xs:sequence>
</xs:complexType>
<xs:element name="TestCase">
<xs:complexType>
<xs:attributeGroup ref="attlist.TestCase"/>
</xs:complexType>
</xs:element>
对于生成可以将xml报告映射到的精确Java类的任何其他建议,我将不胜感激,如果JAXB不能胜任该任务,那么我正在使用Java 1.8
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。