Hey,
 
We are trying to use the below .xsd file content with Castor 0.9.3.
If you observe there exists some circular references among "event",
"location" and "showTime".
 
 
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
  targetNamespace="
http://castor.exolab.org/Test/Invoice">
 
   <xsd:annotation>
      <xsd:documentation>
         This is a reference XML Schema to compare against the generated
         schema from the event mapping xml file.
      </xsd:documentation>
   </xsd:annotation>
 
   <xsd:element name="event">
      <xsd:annotation>
         <xsd:documentation>
             Event description information
         </xsd:documentation>
      </xsd:annotation>
 
      <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="id" type="xsd:long"/>
            <xsd:element name="name" type="xsd:string"/>
            <xsd:element ref="showTime" maxOccurs="unbounded" minOccurs="1"/>
            <xsd:element ref="location" maxOccurs="unbounded" minOccurs="1"/>
       </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
 
   <xsd:element name="location">
      <xsd:annotation>
         <xsd:documentation>
             The physical or virtual location of an event
         </xsd:documentation>
      </xsd:annotation>
 
      <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="id" type="xsd:long"/>
            <xsd:element name="name" type="xsd:string"/>
            <xsd:element ref="showTime" maxOccurs="unbounded" minOccurs="1"/>
            <xsd:element ref="event" maxOccurs="unbounded" minOccurs="1"/>
       </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
 
   <xsd:element name="showTime">
      <xsd:annotation>
         <xsd:documentation>
             Show time information
         </xsd:documentation>
      </xsd:annotation>
 
      <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="id" type="xsd:long"/>
            <xsd:element name="startTime" type="xsd:dateTime"/>
            <xsd:element name="endTime" type="xsd:dateTime"/>
            <xsd:element ref="location"/>
            <xsd:element ref="event"/>
       </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
 
</xsd:schema>
 
We expect castor to process this. But it is resulting in a java.lang.StackOverflowError and terminating.
 
Exception in thread "main" java.lang.StackOverflowError
        at org.exolab.castor.xml.schema.Group.enumerate(Group.java:326)
        at org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.java:1316)
        at org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.java:1403)
        at org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.java:1274)
                    <<<...... the below four lines are repeated for some 100 times here ....>>>
        at org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.java:237)
        at org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.java:1364)
        at org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.java:1403)
        at org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.java:1274)
 
Does anyone know anything about this?
 
thanks
Srikanth Ganapavarapu
[EMAIL PROTECTED]

Reply via email to