Hi,
it looks like you've got validation turned on, otherwise you would not
be getting such a message. Can you please the relevant parts of your
mapping file, especially the exact declaration of the mapping element.
Regards
Werner
sweex wrote:
> Hi!!
>
> I'm having a little problem: I can marshall a class with a mapping file but,
> with the same conditions, I can't unmarshall the XML document generated. I
> don't know why! The error says:
>
> org.exolab.castor.xml.MarshalException: cvc-elt.1: Cannot find the
> declaration of element 'mapping'.
>
>
> The mapping file has <mapping> element, and it's correct, otherwise I
> coudn't marshall!
>
> Can you give a hint to investigate, please?!
>
> Thanks,
>
> Regards.
>
> The complete stacktrace is below:
> -----------------------------------------------------------------------------------------------
>
> org.exolab.castor.xml.MarshalException: cvc-elt.1: Cannot find the
> declaration of element 'mapping'.{File:
> file:///C:/eclipse/Workspace/castor/myMap.xml; line: 3; column: 10}
> at
> org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:755)
> at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:721)
> at
> org.castor.mapping.MappingUnmarshaller.loadMappingInternal(MappingUnmarshaller.java:215)
> at
> org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:124)
> at
> org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:99)
> at org.exolab.castor.xml.Unmarshaller.setMapping(Unmarshaller.java:515)
> at org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:249)
> at validation.test.main(test.java:43)
> Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
> declaration of element 'mapping'.
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)
> ... 6 more
> Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
> declaration of element 'mapping'.
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)
> at
> org.castor.mapping.MappingUnmarshaller.loadMappingInternal(MappingUnmarshaller.java:215)
> at
> org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:124)
> at
> org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:99)
> at org.exolab.castor.xml.Unmarshaller.setMapping(Unmarshaller.java:515)
> at org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:249)
> at validation.test.main(test.java:43)
> Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
> declaration of element 'mapping'.
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)
> at
> org.castor.mapping.MappingUnmarshaller.loadMappingInternal(MappingUnmarshaller.java:215)
> at
> org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:124)
> at
> org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:99)
> at org.exolab.castor.xml.Unmarshaller.setMapping(Unmarshaller.java:515)
> at org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:249)
> at validation.test.main(test.java:43)
>
>
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email