Hi,
I am kinda new to JNI but understand it [and done some tutorials]. I am trying to implement JavaStyle [ a Java vst host that uses JNI ] and have reached a point where i successfully build the native code to a dll, and almost manage to load the native dll library. I do not get a Unsatisfied Link Error, but instead have the JVM close due an internal error.
I am completely lost and dont know what to try now, and I would appreciate any help offered.
I have debugged and the error arrives at the System.load line of code:
static {
System.out.print("Pre loadLibrary...");
System.loadLibrary("JaVaSTyle");
System.out.println("JavaStyle dll loaded in JVSTLibrary");
}
Detail: I compiled the native library with MS visual studio .NET 2003 using the project settings supplied from the CVS repository.
I use Netbeans 6.0 for the java side of things. The console output is:
# An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (0xe0434f4d), pid=1500, tid=6012
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# C [kernel32.dll+0x12a5b]
#
# An error report file with more information is saved as hs_err_pid1500.log
and the error report is :
#
# An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (0xe0434f4d), pid=1500, tid=6012
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# C [kernel32.dll+0x12a5b]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x00297000): JavaThread "main" [_thread_in_native, id=6012]
siginfo: ExceptionCode=0xe0434f4d
Registers:
EAX=0x0090f4c0, EBX=0x00000001, ECX=0x000b0fd0, EDX=0x00000000
ESP=0x0090f4bc, EBP=0x0090f510, ESI=0x00000000, EDI=0x00000000
EIP=0x7c812a5b, EFLAGS=0x00000246
Top of Stack: (sp=0x0090f4bc)
0x0090f4bc: 000b0fd0 e0434f4d 00000001 00000000
0x0090f4cc: 7c812a5b 00000000 791b9d02 02ea1198
0x0090f4dc: 07624998 000b0fd0 0090f4fc 791be271
0x0090f4ec: 000ae008 00000002 07624998 00000000
0x0090f4fc: 0090f50c 791be286 000ae008 07624998
0x0090f50c: 0090f51c 0090f568 7921020d e0434f4d
0x0090f51c: 00000001 00000000 00000000 000b0fd0
0x0090f52c: 0090f578 00000001 7c812a5b 0090f1f0
Instructions: (pc=0x7c812a5b)
0x7c812a4b: 8d 7d c4 f3 a5 5f 8d 45 b0 50 ff 15 08 15 80 7c
0x7c812a5b: 5e c9 c2 10 00 85 ff 0f 8e 36 93 ff ff 8b 55 fc
Stack: [0x008c0000,0x00910000), sp=0x0090f4bc, free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [kernel32.dll+0x12a5b]
C [mscorwks.dll+0x6020d]
C [mscorwks.dll+0x60190]
C [mscorwks.dll+0x60144]
C [mscorwks.dll+0xa6dcb]
C [mscorwks.dll+0x26a7e]
C 0x000b15f6
j java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/String;)V+0
j java.lang.ClassLoader.loadLibrary0(Ljava/lang/Class;Ljava/io/File;)Z+300
j java.lang.ClassLoader.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)V+268
j java.lang.Runtime.loadLibrary0(Ljava/lang/Class;Ljava/lang/String;)V+54
j java.lang.System.loadLibrary(Ljava/lang/String;)V+7
j org.tango.JaVaSTyle.JVSTLibrary.<clinit>()V+10
v ~StubRoutines::call_stub
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/String;)V+0
j java.lang.ClassLoader.loadLibrary0(Ljava/lang/Class;Ljava/io/File;)Z+300
j java.lang.ClassLoader.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)V+268
j java.lang.Runtime.loadLibrary0(Ljava/lang/Class;Ljava/lang/String;)V+54
j java.lang.System.loadLibrary(Ljava/lang/String;)V+7
j org.tango.JaVaSTyle.JVSTLibrary.<clinit>()V+10
v ~StubRoutines::call_stub
j org.tango.JaVaSTyle.Main.main([Ljava/lang/String;)V+3
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x02a6d800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4752]
0x02a68c00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4472]
0x02a67800 JavaThread "Attach Listener" daemon [_thread_blocked, id=2016]
0x02a66c00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=4328]
0x02a62400 JavaThread "Finalizer" daemon [_thread_blocked, id=5072]
0x02a5dc00 JavaThread "Reference Handler" daemon [_thread_blocked, id=5552]
=>0x00297000 JavaThread "main" [_thread_in_native, id=6012]
Other Threads:
0x02a5cc00 VMThread [id=4660]
0x02a6f000 WatcherThread [id=3864]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 960K, used 199K [0x22970000, 0x22a70000, 0x22e50000)
eden space 896K, 22% used [0x22970000, 0x229a1ff0, 0x22a50000)
from space 64K, 0% used [0x22a50000, 0x22a50000, 0x22a60000)
to space 64K, 0% used [0x22a60000, 0x22a60000, 0x22a70000)
tenured generation total 4096K, used 0K [0x22e50000, 0x23250000, 0x26970000)
the space 4096K, 0% used [0x22e50000, 0x22e50000, 0x22e50200, 0x23250000)
compacting perm gen total 12288K, used 23K [0x26970000, 0x27570000, 0x2a970000)
the space 12288K, 0% used [0x26970000, 0x26975c48, 0x26975e00, 0x27570000)
ro space 8192K, 66% used [0x2a970000, 0x2aebf860, 0x2aebfa00, 0x2b170000)
rw space 12288K, 52% used [0x2b170000, 0x2b7bf078, 0x2b7bf200, 0x2bd70000)
Dynamic libraries:
0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0_03\jre\bin\java.exe
0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f5000 C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f02000 C:\WINDOWS\system32\RPCRT4.dll
0x77fe0000 - 0x77ff1000 C:\WINDOWS\system32\Secur32.dll
0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0_03\jre\bin\msvcr71.dll
0x6d870000 - 0x6daba000 C:\Program Files\Java\jdk1.6.0_03\jre\bin\client\jvm.dll
0x7e410000 - 0x7e4a0000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f57000 C:\WINDOWS\system32\GDI32.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.DLL
0x5cd70000 - 0x5cd77000 C:\WINDOWS\system32\serwvdrv.dll
0x5b0a0000 - 0x5b0a7000 C:\WINDOWS\system32\umdmxfrm.dll
0x003a0000 - 0x003ad000 C:\WINDOWS\system32\myokent.dll
0x6d3c0000 - 0x6d3c8000 C:\Program Files\Java\jdk1.6.0_03\jre\bin\hpi.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x6d820000 - 0x6d82c000 C:\Program Files\Java\jdk1.6.0_03\jre\bin\verify.dll
0x6d460000 - 0x6d47f000 C:\Program Files\Java\jdk1.6.0_03\jre\bin\java.dll
0x6d860000 - 0x6d86f000 C:\Program Files\Java\jdk1.6.0_03\jre\bin\zip.dll
0x10000000 - 0x10018000 D:\NetbeansWorkspace\myJavaStyle\JaVaSTyle.dll
0x79170000 - 0x79196000 C:\WINDOWS\system32\mscoree.dll
0x10480000 - 0x1053c000 C:\WINDOWS\system32\MSVCP71D.dll
0x10200000 - 0x10287000 C:\WINDOWS\system32\MSVCR71D.dll
0x77f60000 - 0x77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\msvcrt.dll
0x791b0000 - 0x79412000 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorwks.dll
0x79040000 - 0x79085000 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll
0x7c9c0000 - 0x7d1d6000 C:\WINDOWS\system32\SHELL32.dll
0x773d0000 - 0x774d3000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll
0x5d090000 - 0x5d12a000 C:\WINDOWS\system32\comctl32.dll
0x79780000 - 0x79980000 c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll
0x774e0000 - 0x7761d000 C:\WINDOWS\system32\ole32.dll
0x79430000 - 0x7947c000 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\MSCORJIT.DLL
0x51a70000 - 0x51af0000 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\diasymreader.dll
VM Arguments:
java_command: org.tango.JaVaSTyle.Main
Launcher Type: SUN_STANDARD
Environment Variables:
CLASSPATH=.;C:\jdk1.5.0_09\bin;C:\Program Files\Java\jre1.6.0_03\lib\ext\QTJava.zip
PATH=C:\Program Files\MiKTeX 2.7\miktex\bin;c:\program files\imagemagick-6.3.7-q16;C:\texmf\miktex\bin;C:\Program Files\ActiveState Komodo IDE 4.2\;C:\Program Files\Autodesk\Maya2008\bin;C:\Python25\;C:\Program Files\PC Connectivity Solution\;C:\ORANT\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\GPS Pathfinder Office 3.00;C:\WINDOWS\system32\nls;C:\WINDOWS\system32\nls\ENGLISH;C:\Program Files\Common Files\Motorola\Toolbox;C:\PROGRA~1\COMMON~1\Motorola\Toolbox;C:\Program Files\Novell\ZENworks\;C:\Program Files\Novell\SecureLogin;C:\Program Files\Smart Projects\IsoBuster;C:\Latex\MikTeX\V2.10;C:\PROGRA~1\CA\Common\SCANEN~1;C:\Program Files\CA\Common\ScanEngine;C:\Program Files\CA\SharedComponents\CAUpdate\;C:\Program Files\CA\SharedComponents\ThirdParty\;C:\Program Files\CA\SharedComponents\SubscriptionLicense\;C:\PROGRA~1\CA\ETRUST~1;C:\Program Files\QuickTime\QTSystem\;C:\cygwin\bin;C:\Program Files\Tcl\bin;D:\netbeansWorkspace\myJavaStyle;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Program Files\Csound\bin;C:\Program Files\CVSNT\
USERNAME=hectorj
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows XP Build 2600 Service Pack 2
CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2
Memory: 4k page, physical 1047920k(270244k free), swap 2520456k(1654520k free)
vm_info: Java HotSpot(TM) Client VM (1.6.0_03-b05) for windows-x86, built on Sep 24 2007 22:24:33 by "java_re" with unknown MS VC++:1310