This discussion is archived
2 Replies Latest reply: Aug 29, 2013 2:22 AM by user2659274 RSS

JAXB custom property binding

843834 Newbie
Currently Being Moderated
I have a following problem with my xml schema - I have specified a complex type called Clusters:
<xsd:complexType name="Clusters">
     <xsd:sequence minOccurs="0" maxOccurs="unbounded">
          <xsd:element name="cluster" type="Cluster">
                         <jxb:property name="clusters" />
     <xsd:attribute name="dimensions" type="xsd:positiveInteger" use="required" />
When I'm trying to generate classes it fails with an error:
[xjc] [ERROR] compiler was unable to honor this property customization. It is attached to a wrong place, or its inconsistent with other bindings.
      [xjc]   line 11 of file:/C:/Users/Krzysztof/workspace/Clusters/Clusters/schemas/clusters.xsd
If I remove the minOccurs="0" maxOccurs="unbounded" from the sequence element than classes are generated but obviously clusters field is no longer a List but a Cluster.

What can I do to be able to specify the sequence bounds - minOccurs="0" maxOccurs="unbounded" - and customize the property binding?
Thank you in advance for answering