AnsweredAssumed Answered

Error generating JAVA POJO from scan-1.dtd

Question asked by jen bosy on May 9, 2013
Latest reply on May 13, 2013 by Eric Perraudeau

Hi community -

  I'm trying to create a Java POJO using the scan-1.dtd and getting the following error - any ideas on how to fix it?  What I'm trying to do is "simple" - treat the scan results as a Java Object that I can parse.

 

Details of the error:

 

$ xjc scan-1.dtd -verbose  -nv -dtd -d .

parsing a schema...

compiling a schema...

[INFO] generating code

unknown location

 

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:62)

    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:525)

    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:759)

    at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.generateClassBody(BeanGenerator.java:540)

    at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:243)

    at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:151)

    at com.sun.tools.internal.xjc.model.Model.generateCode(Model.java:275)

    at com.sun.tools.internal.xjc.Driver.run(Driver.java:342)

    at com.sun.tools.internal.xjc.Driver.run(Driver.java:184)

    at com.sun.tools.internal.xjc.Driver._main(Driver.java:107)

    at com.sun.tools.internal.xjc.Driver.access$000(Driver.java:64)

    at com.sun.tools.internal.xjc.Driver$1.run(Driver.java:87)

 

 

XJC version:: xjc 2.2.4-2

 

Thank you in advance!

Outcomes