XSD到POJO Java类

时间:2018-10-26 09:59:58

标签: eclipse xsd jaxb pojo

当我尝试从.xsd文件创建POJO类时遇到问题。 这是XSD文件。 https://docs.oasis-open.org/ebxml-msg/ebms/v3.0/core/os/ebms-header-3_0-200704.xsd 我尝试了2种方法

1。使用Eclipse:我使用具有“生成”功能的Oxygen Eclipse进行生成,但是会引发异常。

[com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
com.sun.xml.internal.bind.api.impl.NameConverter is an interface, and JAXB can't handle interfaces.
    this problem is related to the following location:
        at com.sun.xml.internal.bind.api.impl.NameConverter

2。使用命令行: xjc -d src -p com.travis.examples.xjc oasis.xsd 。抛出错误。

[ERROR] 'lang' is already defined
  line 93 of http://www.w3.org/2001/03/xml.xsd
[ERROR] (related to above error) the first definition appears here
  line 43 of http://www.w3.org/2001/xml.xsd
[ERROR] 'space' is already defined
  line 102 of http://www.w3.org/2001/03/xml.xsd
[ERROR] (related to above error) the first definition appears here
  line 89 of http://www.w3.org/2001/xml.xsd
[ERROR] 'base' is already defined
  line 109 of http://www.w3.org/2001/03/xml.xsd
[ERROR] (related to above error) the first definition appears here
  line 113 of http://www.w3.org/2001/xml.xsd
[ERROR] 'specialAttrs' is already defined
  line 117 of http://www.w3.org/2001/03/xml.xsd
[ERROR] (related to above error) the first definition appears here
  line 157 of http://www.w3.org/2001/xml.xsd

我正在使用Java8_161。

我不知道,我的工作出了什么问题。 谢谢您的宝贵时间!

0 个答案:

没有答案