Hi Pete,

yes I am doing:

    // Initialize the XML4C system
    try {
        XMLPlatformUtils::Initialize();
    }
    catch (const XMLException& toCatch) {

         cerr << "Error during initialization! :\n"
              << StrX(toCatch.getMessage()) << endl;
    }

and at the end:

XMLPlatformUtils::Terminate();

Thanks anyway, I cannot understand why it crashes as I have called the C++ class from a C library and it works fine!!!

esther


Peter Guyatt wrote:
Hi,

        This may sound like a stupid comment to make but have you initialised the
Xerces library by using the XMLPlatformUtils::Initialize(); method ?

if the class with the JNI interface is not in a thread that keeps a constant
handle on the library, it will be garbage collected, so you would need to
initialize and terminate the Xerces library every time you call the native
method.

Thanks

Pete



-----Original Message-----
From: Esther Parrilla Endrino [mailto:[EMAIL PROTECTED]
Sent: 14 August 2003 10:05
To: [EMAIL PROTECTED]
Subject: Xerces C++ and JNI


Hi all,


Well my question is related to Xerces and to JNI too, I apologize if
maybe this is not the correst list to ask for...

I am doing and application in java that must use one class made in C++,
this class calls Xerces C++ to validate files.
Everything is OK using JNI, but the only method that crashes is the one
that calls Xerces... :(

It crashes when it executes:
         parser->parse(xmlFile);

I have checked that the file name is read ok in the C++ class from the
java application but when in this C++ class I try to parse the file it
crashes...

Does someone found the same error somewhere?
Do you know a debugging tool that I can use with JNI?

Thanks in advance,

esther






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to