Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAXB custom property binding

843834Jul 3 2008 — edited Aug 29 2013
Hi,
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">
			<xsd:annotation>
				<xsd:appinfo>
					<jxb:property name="clusters" />
				</xsd:appinfo>
			</xsd:annotation>
		</xsd:element>
	</xsd:sequence>
	<xsd:attribute name="dimensions" type="xsd:positiveInteger" use="required" />
</xsd:complexType>
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 26 2013
Added on Jul 3 2008
2 comments
4,896 views