Perform the following JNI call:
Copy Code code as follows:
Package JNI;
public class Jnitransobject {
Public native testjni[] Objectmethod (String text);
static {
System.loadlibrary ("Jnitransobject");
}
public static void Main (String args[]) {
Jnitransobject jnitransobject = new Jnitransobject ();
testjni[] Testjnis = Jnitransobject.objectmethod ("JNI trans Object");
for (int i = 0; i < testjnis.length; i++) {
System.out.println (Testjnis[i].gettopic ());
}
}
}
When the error is reported as follows:
#
# A Fatal error has been detected by the Java Runtime environment:
#
# exception_access_violation (0xc0000005) at pc=0x6d91c1db, pid=3544, tid=5408
#
# JRE VERSION:6.0_21-B06
# Java Vm:java HotSpot (TM) Client VM (17.0-b16 mixed mode, sharing windows-x86)
# Problematic Frame:
# V [jvm.dll+0x11c1db]
#
# If You are would like to submit a bug and please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
---------------T H R E A D---------------
Current thread (0x01aa6400): Javathread "Main" [_thread_in_vm, id=5408, Stack (0x00160000,0x001b0000)]
siginfo:exceptioncode=0xc0000005, reading address 0x00000009
Registers:
eax=0x00000005, ebx=0x00002000, ecx=0x00000006, edx=0x23b47f28
esp=0x001afa9c, Ebp=0x001afaa8, esi=0x01aa6400, edi=0x01aa6400
EIP=0X6D91C1DB, eflags=0x00010202
Top of Stack: (sp=0x001afa9c)
0x001afa9c:01aa6400 37b19738 3851d3b8 001afaf8
0x001afaac:01b89f47 01aa6518 001afb00 001afb18
0X001AFABC:23B23BC0 001afb10 00000000 00002000
0x001afacc:6d8f1751 01aa6400 00000006 001afad8
0x001afadc:00000000 001afb18 3851ca08 00000000
0x001afaec:3851d3b8 00000000 001afb08 001afb3c
0X001AFAFC:01B82DA1 38b317c8 01b88269 00002000
0x001afb0c:00000000 23b47f28 23b23bc0 00000005
Instructions: (PC=0X6D91C1DB)
0x6d91c1cb:74 5f 8b-D2-8b 8b 5d 8b 00
0X6D91C1DB:8B 8b 8b 5d 1c 8b 55 14
Stack: [0x00160000,0x001b0000], sp=0x001afa9c, free Space=13e001af45ck
Native Frames: (j=compiled Java Code, j=interpreted, VV=VM Code, c=native code)
V [JVM.DLL+0X11C1DB]
J Java.lang.System.arraycopy (LJAVA/LANG/OBJECT;ILJAVA/LANG/OBJECT;II) v+0
J Java.lang.String.getChars (II[CI) v+62
J Java.io.BufferedWriter.write (LJAVA/LANG/STRING;II) v+63
J Java.io.Writer.write (ljava/lang/string;) v+7
J Java.io.PrintStream.write (ljava/lang/string;) v+13
J Java.io.PrintStream.print (ljava/lang/string;) v+9
J Java.io.PrintStream.println (ljava/lang/string;) v+6
J Jni. Jnitransobject.main ([ljava/lang/string;) v+29
V ~stubroutines::call_stub
V [JVM.DLL+0XF3ABC]
V [JVM.DLL+0X1865B1]
V [Jvm.dll+0xf3b3d]
V [jvm.dll+0xfd385]
V [JVM.DLL+0X104FDD]
C [javaw.exe+0x2155]
C [javaw.exe+0x8614]
C [KERNEL32.DLL+0X4ED6C]
C [Ntdll.dll+0x637f5]
C [NTDLL.DLL+0X637C8]
Java frames: (j=compiled java code, j=interpreted, VV=VM code)
J Java.lang.System.arraycopy (LJAVA/LANG/OBJECT;ILJAVA/LANG/OBJECT;II) v+0
J Java.lang.String.getChars (II[CI) v+62
J Java.io.BufferedWriter.write (LJAVA/LANG/STRING;II) v+63
J Java.io.Writer.write (ljava/lang/string;) v+7
J Java.io.PrintStream.write (ljava/lang/string;) v+13
J Java.io.PrintStream.print (ljava/lang/string;) v+9
J Java.io.PrintStream.println (ljava/lang/string;) v+6
J Jni. Jnitransobject.main ([ljava/lang/string;) v+29
V ~stubroutines::call_stub
---------------P R O C E s S---------------
Java Threads: (=> current thread)
0x01b2e800 javathread "Low Memory detector" daemon [_thread_blocked, id=7580, Stack (0x03e10000,0x03e60000)]
0x01b21800 javathread "CompilerThread0" daemon [_thread_blocked, id=6392, Stack (0x03dc0000,0x03e10000)]
0x01b19800 javathread "Attach Listener" daemon [_thread_blocked, id=6364, Stack (0x03d70000,0x03dc0000)]
0X01B16C00 javathread "Signal Dispatcher" daemon [_thread_blocked, id=6360, Stack (0x03d20000,0x03d70000)]
0x01acd000 javathread "Finalizer" daemon [_thread_blocked, id=6348, Stack (0x03cd0000,0x03d20000)]
0x01acb800 javathread "Reference Handler" daemon [_thread_blocked, id=6316, Stack (0x03c80000,0x03cd0000)]
=>0x01aa6400 javathread "Main" [_thread_in_vm, id=5408, Stack (0x00160000,0x001b0000)]
Other Threads:
0x01aca400 Vmthread [stack:0x03c30000,0x03c80000] [id=6320]
0x01b2f400 Watcherthread [stack:0x03e60000,0x03eb0000] [id=4824]
VM State:not at SafePoint (normal execution)
VM Mutex/monitor currently owned by a Thread:none
Heap
def New Generation Total 4928K, used 1479K [0x23b10000, 0x24060000, 0x29060000)
Eden Space 4416K, 33% used [0x23b10000, 0x23c81ef8, 0x23f60000)
From space 512K, 0% used [0x23f60000, 0x23f60000, 0x23fe0000)
To space 512K, 0% used [0x23fe0000, 0x23fe0000, 0x24060000)
Tenured generation total 10944K, used 0K [0x29060000, 0x29b10000, 0x33b10000]
The space 10944K, 0% used [0x29060000, 0x29060000, 0x29060200, 0x29b10000)
Compacting Perm Gen Total 12288K, used 368K [0x33b10000, 0x34710000, 0x37b10000]
The space 12288K, 2% used [0x33b10000, 0x33b6c1d0, 0x33b6c200, 0x34710000)
Ro space 10240K, 51% used [0x37b10000, 0x3803b700, 0x3803b800, 0x38510000)
RW Space 12288K, 54% used [0x38510000, 0x38ba76c0, 0x38ba7800, 0x39110000)
Dynamic Libraries:
0x00400000-0x00424000 C:\Program Files\java\jre6\bin\javaw.exe
0x77720000-0x7785c000 C:\Windows\SYSTEM32\ntdll.dll
0x75b10000-0x75be4000 C:\Windows\system32\kernel32.dll
0x75830000-0x7587a000 C:\Windows\system32\KERNELBASE.dll
0x774c0000-0x77560000 C:\Windows\system32\ADVAPI32.dll
0x77340000-0x773ec000 C:\Windows\system32\msvcrt.dll
0x77870000-0x77889000 C:\Windows\SYSTEM32\sechost.dll
0x760b0000-0x76151000 C:\Windows\system32\RPCRT4.dll
0x75ec0000-0x75f89000 C:\Windows\system32\USER32.dll
0x76010000-0x7605e000 C:\Windows\system32\GDI32.dll
0x75b00000-0x75b0a000 C:\Windows\system32\LPK.dll
0x75a50000-0x75aed000 C:\Windows\system32\USP10.dll
0x77030000-0x7704f000 C:\Windows\system32\IMM32. Dll
0x76db0000-0x76e7c000 C:\Windows\system32\MSCTF.dll
0x7c340000-0x7c396000 C:\Program Files\java\jre6\bin\msvcr71.dll
0x6d800000-0x6daa7000 C:\Program Files\java\jre6\bin\client\jvm.dll
0x755f0000-0x75622000 C:\Windows\system32\WINMM.dll
0x754a0000-0x754ec000 C:\Windows\system32\apphelp.dll
0x6d7b0000-0x6d7bc000 C:\Program Files\java\jre6\bin\verify.dll
0x6d330000-0x6d34f000 C:\Program Files\java\jre6\bin\java.dll
0x6d290000-0x6d298000 C:\Program Files\java\jre6\bin\hpi.dll
0x76e80000-0x76e85000 C:\Windows\system32\PSAPI. Dll
0x6d7f0000-0x6d7ff000 C:\Program Files\java\jre6\bin\zip.dll
0x10000000-0x10039000 E:\workspace\Zhy\JNITransObject.dll
VM Arguments:
Jvm_args:-DFILE.ENCODING=GBK
Java_command:jni. Jnitransobject
Launcher Type:sun_standard
Environment Variables:
Java_home=c:\program files\java\jdk1.6.0_21
Classpath=.; C:\Program Files\java\jdk1.6.0_21\lib\dt.jar; C:\Program Files\java\jdk1.6.0_21\lib\tools.jar
Path=c:/program files/java/jre6/bin/client; C:/Program Files/java/jre6/bin; C:/Program files/java/jre6/lib/i386; C:\Program Files\Common Files\Microsoft Shared\windows Live; C:\Program FILES\AMD app\bin\x86; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files\ati Technologies\ati. ace\core-static; C:\Program Files\Common Files\lenovo; C:\Program Files\Common Files\ulead Systems\mpeg; C:\Program Files\Windows live\shared; C:\SWTOOLS\ReadyApps; C:\Program files\intel\services\ipt\; C:\Program FILES\SYMANTEC\VIP Access client\; C:\Program Files\java\jdk1.6.0_21\bin; C:\Program Files\java\jdk1.6.0_21\jre6\bin; C:\Program Files\tortoisesvn\bin; C:\Program Files\Common Files\thunder Network\kankan\codecs
Username=think
Os=windows_nt
Processor_identifier=x86 Family 6 Model stepping 7, Genuineintel
---------------s Y s T E M---------------
Os:windows 7 Build 7601 Service Pack 1
Cpu:total 4 (8 cores per CPU, 2 threads/CORE) Family 6 model stepping 7, Cmov, cx8, FXSR, MMX, SSE, SSE2, SSE3, SSS E3, sse4.1, sse4.2, POPCNT, HT
memory:4k page, physical 3056880k (1883100k free), swap 6112004k (3307764k free)
Vm_info:java HotSpot (TM) Client VM (17.0-B16) for windows-x86 JRE (1.6.0_21-B06), built on June 00:56:49 by "Java_" Re "with MS VC + + 7.1 (VS2003)
time:wed APR 11 09:46:47 2012
Elapsed time:0 seconds
Errors such as these occur mostly in the JNI-side code, such as improper printf and cout calls, incompatible method invocation types, calls to destroyed objects, and so on.