Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception when calling a java method in JNI  RSS feed

sami suka
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create a new java object inside the native method. I am not getting any compile time errors. But when I try to run I am getting "unexpected expection has been detected out side VM" error. I am postin piece of the code and the error message below.
Help will be highly appreciated.

/*** CODE from .cpp file ***/
jclass empCls = env->FindClass("Employee");
if(empCls == NULL)
return NULL;
jmethodID constructor = env->GetMethodID(empCls,"<init>","()V");
if(constructor == NULL)
return NULL;
jobject empObj= env->NewObject(empCls,constructor);
if(empObj ==NULL)
return NULL;
/***** End of Code ***/
/*** ERROR LOG***/
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : unknown exception code (0xe0434f4d) occurred at PC=0x77E73887
Current Java thread:
at JNItest.getEmployee(Native Method)
at JNItest.main(
Dynamic libraries:
0x00400000 - 0x00406000 c:\j2sdk1.4.2\bin\java.exe
0x77F50000 - 0x77FF7000 C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F46000 C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E5D000 C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78086000 C:\WINDOWS\system32\RPCRT4.dll
0x77C10000 - 0x77C63000 C:\WINDOWS\system32\MSVCRT.dll
0x08000000 - 0x08136000 c:\j2sdk1.4.2\jre\bin\client\jvm.dll
0x77D40000 - 0x77DCC000 C:\WINDOWS\system32\USER32.dll
0x77C70000 - 0x77CB0000 C:\WINDOWS\system32\GDI32.dll
0x76B40000 - 0x76B6C000 C:\WINDOWS\System32\WINMM.dll
0x10000000 - 0x10007000 c:\j2sdk1.4.2\jre\bin\hpi.dll
0x00390000 - 0x0039E000 c:\j2sdk1.4.2\jre\bin\verify.dll
0x003A0000 - 0x003B8000 c:\j2sdk1.4.2\jre\bin\java.dll
0x003C0000 - 0x003CD000 c:\j2sdk1.4.2\jre\bin\zip.dll
0x003F0000 - 0x003FF000 D:\Visual Studio\JNI\Str.dll
0x79170000 - 0x79196000 C:\WINDOWS\system32\mscoree.dll
0x70A70000 - 0x70AD5000 C:\WINDOWS\system32\SHLWAPI.dll
0x791B0000 - 0x79412000 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorwks.dll
0x7C340000 - 0x7C396000 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\MSVCR71.dll
0x79040000 - 0x79085000 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll
0x773D0000 - 0x77BC2000 C:\WINDOWS\system32\SHELL32.dll
0x71950000 - 0x71A34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.10.0_x-ww_f7fb5805\comctl32.dll
0x77340000 - 0x773CB000 C:\WINDOWS\system32\comctl32.dll
0x79780000 - 0x79980000 c:\windows\\framework\v1.1.4322\mscorlib.dll
0x79980000 - 0x79CA6000 c:\windows\assembly\nativeimages1_v1.1.4322\mscorlib\1.0.5000.0__b77a5c561934e089_267dc584\mscorlib.dll
0x79430000 - 0x7947C000 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\MSCORJIT.DLL
0x76C90000 - 0x76CB2000 C:\WINDOWS\system32\imagehlp.dll
0x6D510000 - 0x6D58D000 C:\WINDOWS\system32\DBGHELP.dll
0x77C00000 - 0x77C07000 C:\WINDOWS\system32\VERSION.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\System32\PSAPI.DLL
Heap at VM Abort:
def new generation total 576K, used 186K [0x10010000, 0x100b0000, 0x104f0000)
eden space 512K, 36% used [0x10010000, 0x1003ebf8, 0x10090000)
from space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000)
to space 64K, 0% used [0x100a0000, 0x100a0000, 0x100b0000)
tenured generation total 1408K, used 0K [0x104f0000, 0x10650000, 0x14010000)
the space 1408K, 0% used [0x104f0000, 0x104f0000, 0x104f0200, 0x10650000)
compacting perm gen total 4096K, used 1009K [0x14010000, 0x14410000, 0x18010000)
the space 4096K, 24% used [0x14010000, 0x1410c4f0, 0x1410c600, 0x14410000)
Local Time = Fri Mar 05 14:28:19 2004
Elapsed Time = 1
# The exception above was detected in native code outside the VM
# Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!