Hi!! I'm using castor 1.0.5. I've generated Java classes from XML schema using Castor's Source Generator(through Eclipse Plugin) While trying to unmarshall an XML file the following exception occurs
The following are lines of code I use to perform the unmarshalling Unmarshaller unm = new Unmarshaller(EMMSchema.class); obj = (org.castor.example.schema.SomeClass)unm.unmarshal(reader); Am I going the right way? I am not using any mapping file... Can someone help me with this? The Input Schema has 'imported' another schema and also the target namespace of both the schemas are different unable to find FieldDescriptor for 'import' in ClassDescriptor of EMMSchema{file: [not available]; line: 5; column: 28} at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:732) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:588) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:809) at com.techm.motorola.osf.emmgenerator.schemaObject.EMMSchema.unmarshal(EMM Schema.java:238) at com.techm.motorola.osf.emmgenerator.EMMGeneratorHandler.<init>(EMMGenera torHandler.java:25) at com.techm.motorola.osf.emmgenerator.EMMGeneratorHandler.main(EMMGenerato rHandler.java:55) Caused by: org.xml.sax.SAXException: unable to find FieldDescriptor for 'import' in ClassDescriptor of EMMSchema at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav a:1937) at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav a:1375) at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376) at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLVal idator.java:965) at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentSc anner.java:1858) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatc h(XMLDocumentScanner.java:1234) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScan ner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:718) ... 5 more Caused by: org.xml.sax.SAXException: unable to find FieldDescriptor for 'import' in ClassDescriptor of EMMSchema at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav a:1937) at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav a:1375) at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376) at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLVal idator.java:965) at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentSc anner.java:1858) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatc h(XMLDocumentScanner.java:1234) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScan ner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:718) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:588) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:809) at com.techm.motorola.osf.emmgenerator.schemaObject.EMMSchema.unmarshal(EMM Schema.java:238) at com.techm.motorola.osf.emmgenerator.EMMGeneratorHandler.<init>(EMMGenera torHandler.java:25) at com.techm.motorola.osf.emmgenerator.EMMGeneratorHandler.main(EMMGenerato rHandler.java:55) Caused by: org.xml.sax.SAXException: unable to find FieldDescriptor for 'import' in ClassDescriptor of EMMSchema at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav a:1937) at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav a:1375) at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376) at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLVal idator.java:965) at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentSc anner.java:1858) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatc h(XMLDocumentScanner.java:1234) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScan ner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:718) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:588) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:809) at com.techm.motorola.osf.emmgenerator.schemaObject.EMMSchema.unmarshal(EMM Schema.java:238) at com.techm.motorola.osf.emmgenerator.EMMGeneratorHandler.<init>(EMMGenera torHandler.java:25) at com.techm.motorola.osf.emmgenerator.EMMGeneratorHandler.main(EMMGenerato rHandler.java:55) ---exception---nullEMM Stringnull ============================================================================================================================ Tech Mahindra, formerly Mahindra-British Telecom. Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra. ============================================================================================================================