[xsd-users] Microsoft C++ exception: xercesc_2_6::XMLValid::Codes

Boris Kolpackov boris at codesynthesis.com
Thu Sep 29 15:18:32 EDT 2005


Nelson,

nelson.faria <nelson.faria at netcabo.pt> writes:


> I'm having some stramge problems when mapping from XML. I should point
> out that this code is multithread as it is being ran by a callback function.

Then I suggest that you initialize/terminate Xerces runtime from withing
main(). The parsing function that you are calling below (OSGAannotation)
initializes/terminates Xerces runtime for you but if that happens
concurrently from withing multiple threads bad things can happen. So here
is what I suggest you try:

1. Initialize/Terminate Xerces runtime from within main()

2. Call OSGAannotation() like this:

xsd::cxx::xml::dom::error_handler<char> eh;
std::auto_ptr<class annotationinfo> info (OSGAannotation(*stream, eh));


> and i get this exception:
>
> First-chance exception at 0x7c81eb33 in GIDes.exe: Microsoft C++ exception:
> xercesc_2_6::XMLValid::Codes @ 0x0cefda5c.

Note that xsd runtime lets Xerces exceptions propagate freely. Though
XMLValid::Codes doesn't seem like an exception that Xerces would throw.


> here:
>
> DOMLocatorImpl::~DOMLocatorImpl()
> {
> }

Are you saying the exception was thrown from this destructor?


> I thought xsd was responsible for initiating the XMLParser and thus
> the ErrorHandler as well..

Yes it does. However some "hard" errors (like unavailable transcoder),
which are not errors in XML per se, Xerces reports via exception.

If the above doesn't help, would you be able to send a small Schema and
XML fragment so that I could try to reproduce this problem?

hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20050929/1d4ce581/attachment.pgp


More information about the xsd-users mailing list