users@jaxb.java.net

Re: Stack Overflow during Unmarshal

From: Ed Mooney <Ed.Mooney_at_Sun.COM>
Date: Mon, 21 Nov 2005 14:28:51 -0500

Sounds like the definition of one or more of UNITVERSION, BATTERYSTATUS
or UNITFAULT creates a cycle.

   -- Ed

Matt Minyard wrote:
> Hi,
>
> I'm using JWSDP 1.6 which includes JAXB RI 1.0.5. I compiled a schema
> that includes the following section:
>
> <xs:element name="UNITSTATUS">
> <xs:annotation>
> <xs:documentation>Unit Status Aggregate</xs:documentation>
> </xs:annotation>
> <xs:complexType>
> <xs:sequence minOccurs="0" maxOccurs="unbounded">
>
>
> <xs:element ref="UNITVERSION" minOccurs="0"/>
> <xs:element ref="BATTERYSTATUS" minOccurs="0"/>
> <xs:element ref="UNITFAULT" minOccurs="0" maxOccurs="unbounded"/>
>
>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
>
>
>
> When I try to unmarshall an XML file that includes UNITSTATUS elements
> in the content, I get a java.lang.StackOverflowError. If I change the
> xs:sequence element's maxOccurs to 1, it works fine (as long as the XML
> file only includes 1 UNITSTATUS element). Also, if the XML file doesn't
> include any UNITSTATUS elements, it also works fine.
>
> Does anyone have any idea what might be causing this or how I could
> get around it?
>
>
> Thanks,
>
> Matt