[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] MOXy - [ERROR] Property “Any” is already defined
|
Hi Blaise, MOXy Users,
You found my post on stackoverflow. :-)
Sorry for the multiple posts but I guess I will stick with this mailing list since this is the EclipseLink MOXy community. I will post back the answer to stackoverflow once I have a resolution.
Your suggestion does work only with the JAXB implementation bundles with the JAVA JDK. See below for more detail...
Using the following external JAXB binding XML
works when using the JAXB implementation bundles with
java-1.6.0-openjdk-devel-1.6.0.0-1.45.1.11.1.el6.i686
Command Line Arg: xjc -d ./bindings ./xccdf-1.1.4.xsd -b ./xccdf-1.1.4_jaxb_property.xml
<bindings node="//xsd:complexType[@name='metadataType']/xsd:sequence/xsd:choice">
<bindings node=".//xsd:any[@namespace='
http://purl.org/dc/elements/1.1/']">
<property name="any_purl"/>
</bindings>
<bindings node=".//xsd:any[@namespace='
http://checklists.nist.gov/sccf/0.1']">
<property name="any_checklists"/>
</bindings>
</bindings>
However it doesn't work when using MOXy. When running with MOXy eclipselink-2.4.1.v20121003-ad44345, I got the following...
Command Line Arg: ${ECLIPSELINK_HOME}/bin/jaxb-compiler.sh -d ./bindings ./xccdf-1.1.4.xsd -b ./xccdf-1.1.4_jaxb_property.xml
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy32.required(Unknown Source)
at com.sun.tools.xjc.generator.bean.field.AbstractField.annotateReference(AbstractField.java:197)
at com.sun.tools.xjc.generator.bean.field.AbstractField.annotate(AbstractField.java:156)
at com.sun.tools.xjc.generator.bean.field.AbstractListField.generate(AbstractListField.java:124)
at com.sun.tools.xjc.generator.bean.field.UntypedListField.<init>(UntypedListField.java:107)
at com.sun.tools.xjc.generator.bean.field.UntypedListFieldRenderer.generate(UntypedListFieldRenderer.java:72)
at com.sun.tools.xjc.generator.bean.field.DefaultFieldRenderer.generate(DefaultFieldRenderer.java:79)
at com.sun.tools.xjc.generator.bean.BeanGenerator.generateFieldDecl(BeanGenerator.java:747)
at com.sun.tools.xjc.generator.bean.BeanGenerator.generateClassBody(BeanGenerator.java:535)
at com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:235)
at com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:175)
at com.sun.tools.xjc.model.Model.generateCode(Model.java:286)
at com.sun.tools.xjc.Driver.run(Driver.java:343)
at org.eclipse.persistence.jaxb.xjc.MOXyXJC.main(MOXyXJC.java:48)
Caused by: java.lang.NoSuchMethodException: javax.xml.bind.annotation.XmlElementRef.required()
at java.lang.Class.getDeclaredMethod(Class.java:1954)
at com.sun.codemodel.TypedAnnotationWriter.invoke(TypedAnnotationWriter.java:107)
Is this a bug in MOXy?
Thanks,
David