Я скачал файл cXML.dtd из cxml org и пытаюсь сгенерировать Java-классы, используя приведенную ниже команду, как указано в java world
xjc -dtd -d C:\Users\mansari7\Downloads\cxml\cXML_DTDs\cXML\1.2.042\generatedsrc -p com.ge.hc.healthcareb2bpunchoutaddon.cxml.jaxb cXML.dtd
Но я сталкиваюсь с проблемой, когда говорится, что атрибут дублирован.Ниже приведена ошибка.
parsing a schema...
[ERROR] Property "Name" is already defined. Use <jaxb:property> to resolve this conflict.
line 586 of file:/C:/Users/mansari7/Downloads/cxml/cXML_DTDs/cXML/1.2.042/InvoiceDetail.dtd
Если я переименую атрибут, я получу parsing a schema...
compiling a schema...
Exception in thread "main" java.lang.IllegalArgumentException: trying to create the same field twice: value
at com.sun.codemodel.internal.JDefinedClass.field(JDefinedClass.java:410)
at com.sun.codemodel.internal.JDefinedClass.field(JDefinedClass.java:381)
at com.sun.tools.internal.xjc.generator.bean.field.AbstractFieldWithVar.createField(AbstractFieldWithVar.java:61)
at com.sun.tools.internal.xjc.generator.bean.field.SingleField.<init>(SingleField.java:79)
at com.sun.tools.internal.xjc.generator.bean.field.SingleField.<init>(SingleField.java:66)
at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.sun.tools.internal.xjc.generator.bean.field.GenericFieldRenderer.generate(GenericFieldRenderer.java:54)
at com.sun.tools.internal.xjc.generator.bean.field.DefaultFieldRenderer.generate(DefaultFieldRenderer.java:67)
at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.generateFieldDecl(BeanGenerator.java:762)
at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.generateClassBody(BeanGenerator.java:543)
at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:246)
at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:154)
at com.sun.tools.internal.xjc.model.Model.generateCode(Model.java:275)
at com.sun.tools.internal.xjc.Driver.run(Driver.java:348)
at com.sun.tools.internal.xjc.Driver.run(Driver.java:185)
at com.sun.tools.internal.xjc.Driver._main(Driver.java:108)
at com.sun.tools.internal.xjc.Driver.access$000(Driver.java:65)
at com.sun.tools.internal.xjc.Driver$1.run(Driver.java:88)