You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by suresh <su...@vergiltech.com> on 2001/12/03 11:44:53 UTC

problem loading dll plz help

hi ,

	I have a JNI application running on PIII win2000.The java application loads
a runtime vc dll that parses the content..I have an
EXCEPTION_ACCESS_VIOLATION
thrown when i try to parse the contents passed in from java.

iam using xerces1.5.2 and SAX parser (the dll built is a mulithreaded dll)


NATIVE call

JNIEXPORT void JNICALL Java_Dispatcher_cppParser
  (JNIEnv * m_environment, jobject jobj, jstring m_jxmlData)
{   
    cout<<"here..."<<endl;
    m_environment->MonitorEnter(jobj);
    jclass cls = m_environment->GetObjectClass(jobj);
    jfieldID memberId = m_environment->GetFieldID(cls, "ptr", "I");
    XMLParser* objParser = (XMLParser*) m_environment->GetIntField(jobj,memberId);
    const char* m_xmlData = m_environment->GetStringUTFChars(m_jxmlData, 0);
    MessageFormat objMessageFormat;
    objMessageFormat.setpptName(m_xmlData);
    m_xmlData  = (objMessageFormat.getXmlData()).c_str();

    objMessageFormat = objParser->parse(m_xmlData); 
    m_environment->MonitorExit(jobj);

}

/* PARSE METHOD*/

MessageFormat XMLParser::parse(string strParseBuffer) 
{

	try {
        XMLPlatformUtils::Initialize();
    }
    catch (const XMLException& toCatch) {
        cout << "Error during initialization! :\n"
             << toCatch.getMessage() << "\n";
    }
    
	SAXParser::ValSchemes    valScheme = SAXParser::Val_Auto;
    bool doNamespaces    = false;
    bool doSchema        = false;

   -------------------------------------------------
	I have the exception thrown in the next step                        
   -------------------------------------------------              	                      


    m_parser = XMLReaderFactory::createXMLReader();


--------------------------------------------------------------

--------------------------------------------------------------
	
    XmlFunctionHandler m_Handler;

	m_parser->setContentHandler(&m_Handler);
	m_parser->setLexicalHandler(&m_Handler);
    m_parser->setErrorHandler(&m_Handler);

	m_DataBuf = strParseBuffer.c_str();

	m_ParseBuf = new MemBufInputSource (
		(const XMLByte*)m_DataBuf
        ,strlen(m_DataBuf)
        ,m_MemBufId
        ,true
    );


    try {
       
		m_parser->parse(*m_ParseBuf);
	
		}
    catch (const XMLException& toCatch) {
        cout << "\nFile not found: '" <<"'\n"
             << "Exception message is: \n"
             << toCatch.getMessage() << "\n" ;
    }
	 catch (...)
    {
        cerr << "\nUnexpected exception during parsing: '"<< "'\n";
        XMLPlatformUtils::Terminate();
    }
  
	m_objMessageFormat = m_Handler.getMessageFormat();

    return m_objMessageFormat; 

}    



An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x100051d0
Function name=(N/A)
Library=D:\JNITEST\LoadParser.dll

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.



Current Java thread:
	at Dispatcher.cppParser(Native Method)
	at Dispatcher.DispatchPPT(Dispatcher.java:48)
	at Dispatcher.main(Dispatcher.java:114)

Dynamic libraries:
0x00400000 - 0x00405000 	C:\WINNT\system32\java.exe
0x77F80000 - 0x77FFB000 	C:\WINNT\System32\ntdll.dll
0x77DB0000 - 0x77E0B000 	C:\WINNT\system32\ADVAPI32.dll
0x77E80000 - 0x77F35000 	C:\WINNT\system32\KERNEL32.DLL
0x77D40000 - 0x77DB0000 	C:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78046000 	C:\WINNT\system32\MSVCRT.dll
0x6D420000 - 0x6D4EF000 	C:\Program Files\JavaSoft\JRE\1.3.1\bin\hotspot\jvm.dll
0x77E10000 - 0x77E74000 	C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 	C:\WINNT\system32\GDI32.DLL
0x77570000 - 0x775A0000 	C:\WINNT\system32\WINMM.dll
0x75E60000 - 0x75E7A000 	C:\WINNT\System32\IMM32.DLL
0x681A0000 - 0x681A7000 	C:\WINNT\system32\serwvdrv.dll
0x66740000 - 0x66747000 	C:\WINNT\system32\umdmxfrm.dll
0x6D220000 - 0x6D227000 	C:\Program Files\JavaSoft\JRE\1.3.1\bin\hpi.d
ll
0x6D3B0000 - 0x6D3BD000 	C:\Program Files\JavaSoft\JRE\1.3.1\bin\verify.dll
0x6D250000 - 0x6D266000 	C:\Program Files\JavaSoft\JRE\1.3.1\bin\java.dll
0x6D3C0000 - 0x6D3CD000 	C:\Program Files\JavaSoft\JRE\1.3.1\bin\zip.dll
0x10000000 - 0x10046000 	D:\JNITEST\LoadParser.dll
0x12000000 - 0x12144000 	C:\WINNT\system32\xerces-c_1_5.dll
0x08D70000 - 0x08D8A000 	D:\JNITEST\bridge2java.dll
0x77A50000 - 0x77B46000 	C:\WINNT\system32\ole32.dll
0x779B0000 - 0x77A4B000 	C:\WINNT\system32\OLEAUT32.dll
0x77920000 - 0x77943000 	C:\WINNT\system32\imagehlp.dll
0x72A00000 - 0x72A2D000 	C:\WINNT\system32\DBGHELP.dll
0x690A0000 - 0x690AB000 	C:\WINNT\system32\PSAPI.DLL

Local Time = Mon Dec 03 16:03:03 2001
Elapsed Time = 0
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.3.1-b24 mixed mode)
#


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org