Hi,
I have a recursive xsd (mimicks MIME to some degree) that looks
something like this
<xsd:element name="bodyPart">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="bodyHeader"
minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="bodyRecord"/>
</xsd:sequence>
<xsd:attribute name="type" type="partType"
use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="bodyRecord">
<xsd:complexType>
<xsd:choice>
<xsd:element ref="body"/>
<xsd:element ref="bodyPart"
maxOccurs="unbounded"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
This causes castor source generator to go into infinite loop with the
following trace
-- Suppressing non fatal warnings.
Creating classes for element: noitfyBCCUrl
Creating classes for element: bodyPart
Exception in thread "main" java.lang.StackOverflowError
at
org.exolab.castor.xml.schema.FacetListEnumerator.<init>(FacetListEnum
erator.java:75)
at
org.exolab.castor.xml.schema.SimpleType.getFacets(SimpleType.java:129
)
at
org.exolab.castor.xml.schema.SimpleType.getFacets(SimpleType.java:127
)
at
org.exolab.castor.builder.SourceFactory.processEnumerationAsNewObject
(SourceFactory.java:1499)
at
org.exolab.castor.builder.SourceFactory.processEnumeration(SourceFact
ory.java:1484)
at
org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactor
y.java:565)
at
org.exolab.castor.builder.SourceFactory.processComplexType(SourceFact
ory.java:1253)
at
org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactor
y.java:237)
at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFac
tory.java:1364)
at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFac
tory.java:1403)
at
org.exolab.castor.builder.SourceFactory.processComplexType(SourceFact
ory.java:1274)
at
org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactor
y.java:237)
at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFac
tory.java:1364)
at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFac
tory.java:1403)
at
org.exolab.castor.builder.SourceFactory.processComplexType(SourceFact
ory.java:1274)
This happens with latest Castor jar (0.93). Any solutoins to this, or
this is a know limitation?
Another problem I have is that original schema looked like this
<xsd:element name="bodyPart">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="bodyHeader"
minOccurs="0" maxOccurs="unbounded"/>
<xsd:choice>
<xsd:element ref="body"/>
<xsd:element ref="bodyPart"
maxOccurs="unbounded"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="type" type="partType"
use="required"/>
</xsd:complexType>
</xsd:element>
which caused Castor source generator to produce the following error
Creating classes for group: null
cannot create classes for unnamed nested groups
I fixed it by changing schema to look like the one in the beginning of
this e-mail, but then I am stuck with infinite loop.
thanks for your help,
- Ilya
------------------------------------
Ilya Lipkind
Talaris Corporation [formerly Gazoo Corporation]
1145 Market Street, Suite 100
San Francisco, CA 94103
(408) 730-3369 phone
------------------------------------
Ilya Lipkind
Talaris Corporation [formerly Gazoo Corporation]
1145 Market Street, Suite 100
San Francisco, CA 94103
(408) 730-3369 phone
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev