XML mapping inheritance problem; missing class indicator field

Advertisement
Hi!
I am currently working on a project which involves mapping a large domain model on a XSD schema. For this we use Toplink 10.1.3.1 which is mostly great. But now I have a problem while wanting to use class inheritance.
In my XSD I have the following defined
<xs:complexType name="Traject">
     <xs:sequence>
          <xs:element name="SoortTraject" type="SoortTraject"/>
     </xs:sequence>
</xs:complexType>
<xs:complexType name="SpecialTraject">
     <xs:complexContent>
          <xs:extension base="Traject">
               <xs:sequence>
                             [some elements] 
               </xs:sequence>
          </xs:extension>
     </xs:complexContent>
</xs:complexType>My XML is an implementation of this XSD and looks like this
<Trajecten>
        <Traject xsi:type="SpecialTraject">
                 [implementation of the elements]
         </Traject>
</Trajecten>My domain model corresponts to the XSD, so there is a Traject object and an inherited SpecialTraject object.
In the mapping I used the Advanced properties->inheritance on both descriptors telling the Traject descriptor that it was the 'Root Parent Descriptor' ('Use class indicator field' -> 'use XML Schema Type attribute', 'Use class indicator dictionary') and the SpecialTraject what it Child Descriptor was ('Traject').
When I test my mapping it always results in the same error (no matter how I configure this inheritance mapping). It says :
[TOPLINK-44] missing class indicator field
Descriptor: XMLDescriptor(Traject --> [])What am I doing wrong? Does anybody know a sollution?
Best regards,
Jouke Stoel
Developer
Advertisement

Replay

This is the changed XML descriptor file. When I deploy the file it automaticly overrides the old file so it ain't possible that I was still using the wrong file
<toplink:class-indicator-mappings>
    <toplink:class-indicator-mapping>
        <toplink:class>Traject</toplink:class>
        <toplink:class-indicator xsi:type="xsd:string">Traject</toplink:class-indicator>
    </toplink:class-indicator-mapping>
    <toplink:class-indicator-mapping>
        <toplink:class>SpecialTraject</toplink:class>
        <toplink:class-indicator xsi:type="xsd:string">SpecialTraject</toplink:class-indicator>
    </toplink:class-indicator-mapping>
</toplink:class-indicator-mappings>I have posted the stacktrace but I had to translate a bit because my exception was in Dutch :)
Locale is a great invention
Exception [TOPLINK-44] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DescriptorException
Exception description: Missing class indicator field of database row [UnmarshalRecord()].
Descriptor: XMLDescriptor(Traject --> [])
     at oracle.toplink.exceptions.DescriptorException.missingClassIndicatorField(DescriptorException.java:887)
     at oracle.toplink.internal.ox.QNameInheritancePolicy.classFromRow(QNameInheritancePolicy.java:84)
     at oracle.toplink.internal.ox.XMLRelationshipMappingNodeValue.processChild(XMLRelationshipMappingNodeValue.java:13)
     at oracle.toplink.internal.ox.XMLCompositeCollectionMappingNodeValue.startElement(XMLCompositeCollectionMappingNodeValue.java:62)
     at oracle.toplink.ox.record.UnmarshalRecord.startElement(UnmarshalRecord.java:352)
     at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
     at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
     at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
     at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:205)
     at oracle.toplink.internal.ox.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:189)
     at oracle.toplink.internal.ox.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:147)
     at oracle.toplink.ox.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:228)
.