问题
I created a Java chat application several years ago on my 32-bit system and am using native code to achieve a window flash when a message is received and the window is minimized. I recompiled the C++ code that does the flashing with a 64-bit compiler and I have the 64-bit JRE version. However, when attempting to run the flash, I get an exception.
Below is the C++ code and below that is the output of the log file. Thanks for any insight.
#include "FlashWindow.h"
#include <jawt_md.h>
#include <assert.h>
// Handle to JAWT
//HMODULE hJAWT = NULL;
JNIEXPORT void JNICALL Java_chatwindow_FlashWindow_flashWindow(JNIEnv* env, jobject obj, jobject panel)
{
JAWT awt;
JAWT_DrawingSurface* ds;
JAWT_DrawingSurfaceInfo* dsi;
JAWT_Win32DrawingSurfaceInfo* dsi_win;
jboolean result;
jint lock;
// Call to get JAWT handle
typedef jboolean (JNICALL *PJAWT_GETAWT)(JNIEnv*, JAWT*);
HMODULE hJAWT = 0;
wchar_t* path1 = L"jawt.dll";
wchar_t* path2 = L"awt.dll";
if (!hJAWT)
hJAWT = LoadLibraryW(path1);
if (!hJAWT)
hJAWT = LoadLibraryW(path2);
//PJAWT_GETAWT JAWT_GetAWT = (PJAWT_GETAWT)GetProcAddress(hJAWT, "_JAWT_GetAWT@8");
PJAWT_GETAWT JAWT_GetAWT = (PJAWT_GETAWT)GetProcAddress(hJAWT, "JAWT_GetAWT"); // newer version 1.6
// Get the AWT
awt.version = JAWT_VERSION_1_4;
result = JAWT_GetAWT(env, &awt);
assert(result != JNI_FALSE);
// Get the drawing surface
ds = awt.GetDrawingSurface(env, panel);
if (ds == NULL)
return;
// Lock the drawing surface
lock = ds->Lock(ds);
assert((lock & JAWT_LOCK_ERROR) == 0);
// Get the drawing surface info
dsi = ds->GetDrawingSurfaceInfo(ds);
// Get the platform-specific drawing info
dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
FlashWindow(dsi_win->hwnd, TRUE);
// Free the drawing surface info
ds->FreeDrawingSurfaceInfo(dsi);
// Unlock the drawing surface
ds->Unlock(ds);
// Free the drawing surface
awt.FreeDrawingSurface(ds);
}
This is the Log file:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000000000000, pid=4484, tid=8596
#
# JRE version: 7.0_05-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.1-b03 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C 0x0000000000000000
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x0000000009ecf800): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=8596, stack(0x000000000a630000,0x000000000a730000)]
siginfo: ExceptionCode=0xc0000005, ExceptionInformation=0x0000000000000008 0x0000000000000000
Registers:
RAX=0x0000000000000006, RBX=0x00000000bc26a520, RCX=0x0000000009ecf9d8, RDX=0x000000000a72e240
RSP=0x000000000a72e1e8, RBP=0x000000000a72e310, RSI=0x00000000bbc62df8, RDI=0x00000000021a63d3
R8 =0x000000000a72c408, R9 =0x000000000a72c690, R10=0x0000000000000000, R11=0x0000000000000246
R12=0x0000000000000000, R13=0x00000000bc26a520, R14=0x000000000a72e338, R15=0x0000000009ecf800
RIP=0x0000000000000000, EFLAGS=0x0000000000010206
Top of Stack: (sp=0x000000000a72e1e8)
0x000000000a72e1e8: 000007fefc0310e0 000007fefc0392e4
0x000000000a72e1f8: 0000000000000000 00000000777d0000
0x000000000a72e208: 00000000000003be 000007fefc0392a8
0x000000000a72e218: 00000000bbc62df8 0000000009ec9840
0x000000000a72e228: 000000006c550000 000000000a72e798
0x000000000a72e238: 000007fefc039290 0000000000010004
0x000000000a72e248: 0000000009ebbe28 00000000bbc62df8
0x000000000a72e258: 00000000021a63d3 00000000bc26a520
0x000000000a72e268: 00000000021b2215 0000000009ebbe00
0x000000000a72e278: 0000000000000000 000000000a72e310
0x000000000a72e288: 0000000009ebbe68 00000000fffffffe
0x000000000a72e298: 00000000021b2388 0000000009ecf9d8
0x000000000a72e2a8: 000000000a72e338 000000000a72e330
0x000000000a72e2b8: 00000000bb6b399b 0000000009ecf800
0x000000000a72e2c8: 000000000a72e398 000000000a72e2d0
0x000000000a72e2d8: 00000000bc26a520 000000000a72e338
Instructions: (pc=0x0000000000000000)
0x00000000ffffffe0:
Register to memory mapping:
RAX=0x0000000000000006 is an unknown value
RBX=0x00000000bc26a520 is an oop
{method}
- klass: {other class}
RCX=0x0000000009ecf9d8 is an unknown value
RDX=0x000000000a72e240 is pointing into the stack for thread: 0x0000000009ecf800
RSP=0x000000000a72e1e8 is pointing into the stack for thread: 0x0000000009ecf800
RBP=0x000000000a72e310 is pointing into the stack for thread: 0x0000000009ecf800
RSI=0x00000000bbc62df8 is an oop
{instance class}
- klass: {other class}
RDI=0x00000000021a63d3 is an Interpreter codelet
return entry points [0x00000000021a5820, 0x00000000021a7620] 7680 bytes
R8 =0x000000000a72c408 is pointing into the stack for thread: 0x0000000009ecf800
R9 =0x000000000a72c690 is pointing into the stack for thread: 0x0000000009ecf800
R10=0x0000000000000000 is an unknown value
R11=0x0000000000000246 is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x00000000bc26a520 is an oop
{method}
- klass: {other class}
R14=0x000000000a72e338 is pointing into the stack for thread: 0x0000000009ecf800
R15=0x0000000009ecf800 is a thread
Stack: [0x000000000a630000,0x000000000a730000], sp=0x000000000a72e1e8, free space=1016k
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j chatwindow.FlashWindow.flashWindow(Ljava/awt/Window;)V+0
j chatwindow.FlashWindow.actionPerformed(Ljava/awt/event/ActionEvent;)V+5
j javax.swing.Timer.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+35
j javax.swing.Timer$DoPostEvent.run()V+74
j java.awt.event.InvocationEvent.dispatch()V+47
j java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+21
j java.awt.EventQueue.access$000(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V+3
j java.awt.EventQueue$3.run()Ljava/lang/Void;+12
j java.awt.EventQueue$3.run()Ljava/lang/Object;+1
v ~StubRoutines::call_stub
j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0
j java.security.ProtectionDomain$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+28
j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46
j java.awt.EventDispatchThread.pumpOneEventForFilters(I)V+245
j java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+48
j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j java.awt.EventDispatchThread.run()V+9
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x000000000b387000 JavaThread "Thread-6" [_thread_in_native, id=1524, stack(0x000000000e6e0000,0x000000000e7e0000)]
0x0000000009fbb800 JavaThread "Thread-5" [_thread_in_native, id=23732, stack(0x000000000e340000,0x000000000e440000)]
0x0000000009fba800 JavaThread "Thread-4" [_thread_blocked, id=6708, stack(0x000000000e480000,0x000000000e580000)]
0x000000000b5e1000 JavaThread "TimerQueue" daemon [_thread_blocked, id=20876, stack(0x000000000def0000,0x000000000dff0000)]
0x0000000001c2c000 JavaThread "DestroyJavaVM" [_thread_blocked, id=14396, stack(0x00000000020a0000,0x00000000021a0000)]
=>0x0000000009ecf800 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=8596, stack(0x000000000a630000,0x000000000a730000)]
0x0000000009e71800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=16484, stack(0x000000000a4b0000,0x000000000a5b0000)]
0x0000000009e70800 JavaThread "AWT-Shutdown" [_thread_blocked, id=4076, stack(0x0000000009b70000,0x0000000009c70000)]
0x00000000085a0800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=8804, stack(0x000000000a250000,0x000000000a350000)]
0x000000000856c000 JavaThread "Service Thread" daemon [_thread_blocked, id=8644, stack(0x0000000009a20000,0x0000000009b20000)]
0x0000000008560800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=8480, stack(0x0000000009590000,0x0000000009690000)]
0x0000000008557000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=7688, stack(0x00000000098f0000,0x00000000099f0000)]
0x0000000008555000 JavaThread "Attach Listener" daemon [_thread_blocked, id=8840, stack(0x0000000009700000,0x0000000009800000)]
0x0000000008553800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=23208, stack(0x0000000009460000,0x0000000009560000)]
0x00000000084ce800 JavaThread "Finalizer" daemon [_thread_blocked, id=8204, stack(0x0000000009340000,0x0000000009440000)]
0x00000000084c3800 JavaThread "Reference Handler" daemon [_thread_blocked, id=16568, stack(0x0000000009150000,0x0000000009250000)]
Other Threads:
0x00000000084bd800 VMThread [stack: 0x0000000008fe0000,0x00000000090e0000] [id=12092]
0x0000000008577000 WatcherThread [stack: 0x0000000009cd0000,0x0000000009dd0000] [id=25236]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
PSYoungGen total 18944K, used 5492K [0x00000000ead60000, 0x00000000ec280000, 0x0000000000000000)
eden space 16256K, 17% used [0x00000000ead60000,0x00000000eb023b38,0x00000000ebd40000)
from space 2688K, 99% used [0x00000000ebd40000,0x00000000ebfd9780,0x00000000ebfe0000)
to space 2688K, 0% used [0x00000000ebfe0000,0x00000000ebfe0000,0x00000000ec280000)
ParOldGen total 43328K, used 1169K [0x00000000c0800000, 0x00000000c3250000, 0x00000000ead60000)
object space 43328K, 2% used [0x00000000c0800000,0x00000000c0924768,0x00000000c3250000)
PSPermGen total 21248K, used 13781K [0x00000000bb600000, 0x00000000bcac0000, 0x00000000c0800000)
object space 21248K, 64% used [0x00000000bb600000,0x00000000bc375570,0x00000000bcac0000)
Code Cache [0x00000000021a0000, 0x0000000002410000, 0x00000000051a0000)
total_blobs=545 nmethods=91 adapters=405 free_code_cache=48341Kb largest_free_block=49473088
Compilation events (10 events):
Event: 7.678 Thread 0x0000000008557000 nmethod 83 0x000000000226c290 code [0x000000000226c400, 0x000000000226c518]
Event: 7.679 Thread 0x0000000008560800 nmethod 84 0x000000000226da10 code [0x000000000226db60, 0x000000000226dcb8]
Event: 7.679 Thread 0x0000000008557000 85 ! sun.awt.AppContext::get (121 bytes)
Event: 7.681 Thread 0x0000000008560800 86 s java.util.Hashtable::get (69 bytes)
Event: 7.684 Thread 0x0000000008560800 nmethod 86 0x000000000226d190 code [0x000000000226d2e0, 0x000000000226d818]
Event: 7.687 Thread 0x0000000008557000 nmethod 85 0x000000000226b450 code [0x000000000226b5c0, 0x000000000226bdd8]
Event: 8.873 Thread 0x0000000008560800 87 java.awt.Component::getTreeLock (4 bytes)
Event: 8.874 Thread 0x0000000008560800 nmethod 87 0x000000000226cf90 code [0x000000000226d0c0, 0x000000000226d118]
Event: 11.592 Thread 0x0000000008557000 88 java.util.Hashtable$Enumerator::hasMoreElements (53 bytes)
Event: 11.595 Thread 0x0000000008557000 nmethod 88 0x000000000226cc10 code [0x000000000226cd40, 0x000000000226ceb8]
GC Heap History (2 events):
Event: 6.628 GC heap before
{Heap before GC invocations=1 (full 0):
PSYoungGen total 18944K, used 16256K [0x00000000ead60000, 0x00000000ec280000, 0x0000000000000000)
eden space 16256K, 100% used [0x00000000ead60000,0x00000000ebd40000,0x00000000ebd40000)
from space 2688K, 0% used [0x00000000ebfe0000,0x00000000ebfe0000,0x00000000ec280000)
to space 2688K, 0% used [0x00000000ebd40000,0x00000000ebd40000,0x00000000ebfe0000)
ParOldGen total 43328K, used 0K [0x00000000c0800000, 0x00000000c3250000, 0x00000000ead60000)
object space 43328K, 0% used [0x00000000c0800000,0x00000000c0800000,0x00000000c3250000)
PSPermGen total 21248K, used 12632K [0x00000000bb600000, 0x00000000bcac0000, 0x00000000c0800000)
object space 21248K, 59% used [0x00000000bb600000,0x00000000bc2562f0,0x00000000bcac0000)
Event: 6.648 GC heap after
Heap after GC invocations=1 (full 0):
PSYoungGen total 18944K, used 2661K [0x00000000ead60000, 0x00000000ec280000, 0x0000000000000000)
eden space 16256K, 0% used [0x00000000ead60000,0x00000000ead60000,0x00000000ebd40000)
from space 2688K, 99% used [0x00000000ebd40000,0x00000000ebfd9780,0x00000000ebfe0000)
to space 2688K, 0% used [0x00000000ebfe0000,0x00000000ebfe0000,0x00000000ec280000)
ParOldGen total 43328K, used 1169K [0x00000000c0800000, 0x00000000c3250000, 0x00000000ead60000)
object space 43328K, 2% used [0x00000000c0800000,0x00000000c0924768,0x00000000c3250000)
PSPermGen total 21248K, used 12632K [0x00000000bb600000, 0x00000000bcac0000, 0x00000000c0800000)
object space 21248K, 59% used [0x00000000bb600000,0x00000000bc2562f0,0x00000000bcac0000)
}
Deoptimization events (10 events):
Event: 1.110 Thread 0x0000000009ecf800 Uncommon trap -34 fr.pc 0x0000000002217520
Event: 1.110 Thread 0x0000000009ecf800 Uncommon trap -34 fr.pc 0x0000000002217520
Event: 1.346 Thread 0x0000000009ecf800 Uncommon trap -83 fr.pc 0x00000000022253f4
Event: 1.599 Thread 0x0000000009ecf800 Uncommon trap 43 fr.pc 0x00000000022178d8
Event: 1.784 Thread 0x0000000009ecf800 Uncommon trap -83 fr.pc 0x000000000221fda0
Event: 3.203 Thread 0x0000000001c2c000 Uncommon trap -83 fr.pc 0x0000000002231340
Event: 3.265 Thread 0x0000000009ecf800 Uncommon trap -83 fr.pc 0x0000000002230f2c
Event: 5.264 Thread 0x0000000009ecf800 Uncommon trap -83 fr.pc 0x0000000002230ba8
Event: 5.354 Thread 0x000000000b442000 Uncommon trap -28 fr.pc 0x000000000225b1e0
Event: 5.496 Thread 0x000000000b442000 Uncommon trap 216 fr.pc 0x0000000002264ed0
Internal exceptions (10 events):
Event: 5.454 Thread 0x0000000009fbb800 Threw 0x00000000ebcec140 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 5.473 Thread 0x0000000009fbb800 Threw 0x00000000ebcf7e40 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.565 Thread 0x0000000009ecf800 Threw 0x00000000ead944e8 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.570 Thread 0x0000000009ecf800 Threw 0x00000000ead9e420 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.578 Thread 0x0000000009ecf800 Threw 0x00000000eadab9d0 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.581 Thread 0x0000000009ecf800 Threw 0x00000000eadafd50 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.582 Thread 0x0000000009ecf800 Threw 0x00000000eadb1f20 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.669 Thread 0x0000000009ecf800 Threw 0x00000000eaed1798 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.675 Thread 0x0000000009ecf800 Threw 0x00000000eaeec558 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.686 Thread 0x0000000009ecf800 Threw 0x00000000eaefbaf0 at C:\jdk7u1_64p\jdk7u5\hotspot\src\share\vm\prims\jvm.cpp:1166
Events (10 events):
Event: 11.595 Executing VM operation: RevokeBias
Event: 11.595 Executing VM operation: RevokeBias done
Event: 11.595 Executing VM operation: RevokeBias
Event: 11.595 Executing VM operation: RevokeBias done
Event: 11.596 Executing VM operation: RevokeBias
Event: 11.596 Executing VM operation: RevokeBias done
Event: 11.597 Executing VM operation: RevokeBias
Event: 11.597 Executing VM operation: RevokeBias done
Event: 11.599 Executing VM operation: RevokeBias
Event: 11.599 Executing VM operation: RevokeBias done
Dynamic libraries:
0x000000003f800000 - 0x000000003f833000 C:\Windows\system32\java.exe
0x00000000777d0000 - 0x0000000077979000 C:\Windows\SYSTEM32\ntdll.dll
0x00000000770f0000 - 0x000000007720f000 C:\Windows\system32\kernel32.dll
0x00000000fdf30000 - 0x00000000fdf9c000 C:\Windows\system32\KERNELBASE.dll
0x00000000ff4b0000 - 0x00000000ff58b000 C:\Windows\system32\ADVAPI32.dll
0x00000000ff7e0000 - 0x00000000ff87f000 C:\Windows\system32\msvcrt.dll
0x00000000ff880000 - 0x00000000ff89f000 C:\Windows\SYSTEM32\sechost.dll
0x00000000fefc0000 - 0x00000000ff0ed000 C:\Windows\system32\RPCRT4.dll
0x00000000774c0000 - 0x00000000775ba000 C:\Windows\system32\USER32.dll
0x00000000ff770000 - 0x00000000ff7d7000 C:\Windows\system32\GDI32.dll
0x00000000ff970000 - 0x00000000ff97e000 C:\Windows\system32\LPK.dll
0x00000000ff5a0000 - 0x00000000ff669000 C:\Windows\system32\USP10.dll
0x00000000fc5f0000 - 0x00000000fc7e4000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll
0x00000000ffa60000 - 0x00000000ffad1000 C:\Windows\system32\SHLWAPI.dll
0x00000000fef70000 - 0x00000000fef9e000 C:\Windows\system32\IMM32.DLL
0x00000000ff3a0000 - 0x00000000ff4a9000 C:\Windows\system32\MSCTF.dll
0x000000006c6f0000 - 0x000000006c7c1000 C:\Program Files\Java\jre7\bin\msvcr100.dll
0x00000000611f0000 - 0x000000006190a000 C:\Program Files\Java\jre7\bin\server\jvm.dll
0x00000000f9af0000 - 0x00000000f9af9000 C:\Windows\system32\WSOCK32.dll
0x00000000ff920000 - 0x00000000ff96d000 C:\Windows\system32\WS2_32.dll
0x00000000ff590000 - 0x00000000ff598000 C:\Windows\system32\NSI.dll
0x00000000fb0c0000 - 0x00000000fb0fb000 C:\Windows\system32\WINMM.dll
0x0000000077990000 - 0x0000000077997000 C:\Windows\system32\PSAPI.DLL
0x0000000071700000 - 0x000000007170f000 C:\Program Files\Java\jre7\bin\verify.dll
0x000000006dca0000 - 0x000000006dcc8000 C:\Program Files\Java\jre7\bin\java.dll
0x0000000070a90000 - 0x0000000070aa5000 C:\Program Files\Java\jre7\bin\zip.dll
0x000000006c550000 - 0x000000006c6e4000 C:\Program Files\Java\jre7\bin\awt.dll
0x00000000ff980000 - 0x00000000ffa57000 C:\Windows\system32\OLEAUT32.dll
0x00000000ff190000 - 0x00000000ff393000 C:\Windows\system32\ole32.dll
0x00000000fb4a0000 - 0x00000000fb4b8000 C:\Windows\system32\DWMAPI.DLL
0x00000000fb8d0000 - 0x00000000fb926000 C:\Windows\system32\uxtheme.dll
0x00000000fdb20000 - 0x00000000fdb2f000 C:\Windows\system32\CRYPTBASE.dll
0x00000000fe1e0000 - 0x00000000fef68000 C:\Windows\system32\SHELL32.dll
0x000000006da90000 - 0x000000006dac4000 C:\Program Files\Java\jre7\bin\fontmanager.dll
0x000000006df30000 - 0x000000006df49000 C:\Program Files\Java\jre7\bin\net.dll
0x00000000fd400000 - 0x00000000fd455000 C:\Windows\system32\mswsock.dll
0x00000000fd3f0000 - 0x00000000fd3f7000 C:\Windows\System32\wship6.dll
0x000000006ddb0000 - 0x000000006ddc1000 C:\Program Files\Java\jre7\bin\nio.dll
0x000000006da40000 - 0x000000006da81000 C:\Program Files\Java\jre7\bin\t2k.dll
0x00000000fbc90000 - 0x00000000fbcb2000 C:\JavaChat\JavaClient\Versions\2007\9_30_2007\TrayIcon12.dll
0x00000000ff6d0000 - 0x00000000ff769000 C:\Windows\system32\CLBCatQ.DLL
0x00000000fb330000 - 0x00000000fb45a000 C:\Windows\system32\WindowsCodecs.dll
0x00000000fdac0000 - 0x00000000fdb17000 C:\Windows\system32\apphelp.dll
0x00000000f5350000 - 0x00000000f5385000 C:\Windows\system32\EhStorShell.dll
0x00000000fe000000 - 0x00000000fe1d7000 C:\Windows\system32\SETUPAPI.dll
0x00000000fdfa0000 - 0x00000000fdfd6000 C:\Windows\system32\CFGMGR32.dll
0x00000000fdfe0000 - 0x00000000fdffa000 C:\Windows\system32\DEVOBJ.dll
0x00000000fc470000 - 0x00000000fc59c000 C:\Windows\system32\PROPSYS.dll
0x00000000f3360000 - 0x00000000f39d2000 C:\PROGRA~1\MICROS~2\Office14\GROOVEEX.DLL
0x00000000738b0000 - 0x0000000073953000 C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251\MSVCR90.dll
0x0000000073290000 - 0x0000000073363000 C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251\MSVCP90.dll
0x0000000071f90000 - 0x0000000071fbf000 C:\Windows\WinSxS\amd64_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.30729.6161_none_0a1fd3a3a768b895\ATL90.DLL
0x00000000f2f40000 - 0x00000000f335a000 C:\PROGRA~1\COMMON~1\MICROS~1\OFFICE14\Cultures\office.odf
0x00000000f26d0000 - 0x00000000f2f35000 C:\PROGRA~1\MICROS~2\Office14\1033\GrooveIntlResource.dll
0x00000000f51a0000 - 0x00000000f5220000 C:\Windows\system32\ntshrui.dll
0x00000000fd820000 - 0x00000000fd843000 C:\Windows\system32\srvcli.dll
0x00000000f5060000 - 0x00000000f506f000 C:\Windows\system32\cscapi.dll
0x00000000fabf0000 - 0x00000000fabfb000 C:\Windows\system32\slc.dll
0x00000000619e0000 - 0x0000000061a1d000 C:\Windows\system32\pfmshx_70A.dll
0x00000000fda80000 - 0x00000000fdaa5000 C:\Windows\system32\SspiCli.dll
0x00000000fce10000 - 0x00000000fce17000 C:\Windows\System32\wshtcpip.dll
0x00000000f5e40000 - 0x00000000f5e6e000 C:\Program Files\Common Files\Microsoft Shared\Windows Live\WLIDNSP.DLL
0x00000000fd7c0000 - 0x00000000fd81b000 C:\Windows\system32\DNSAPI.dll
0x0000000071f50000 - 0x0000000071f76000 C:\Program Files\Bonjour\mdnsNSP.dll
0x00000000fa9e0000 - 0x00000000faa07000 C:\Windows\system32\Iphlpapi.DLL
0x00000000fa9a0000 - 0x00000000fa9ab000 C:\Windows\system32\WINNSI.DLL
0x00000000f5e30000 - 0x00000000f5e38000 C:\Windows\system32\rasadhlp.dll
0x00000000fa860000 - 0x00000000fa8b3000 C:\Windows\System32\fwpuclnt.dll
0x00000000fc030000 - 0x00000000fc042000 C:\JavaChat\JavaClient\Versions\2007\9_30_2007\flashwindow.dll
0x00000000f5c70000 - 0x00000000f5d95000 C:\Windows\system32\dbghelp.dll
VM Arguments:
java_command: main.JavaChatClient
Launcher Type: SUN_STANDARD
Environment Variables:
CLASSPATH=.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
PATH=C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Dell\Dell Wireless WLAN Card;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem
USERNAME=Chris
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 7 , 64 bit Build 7601 Service Pack 1
CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, tsc
Memory: 4k page, physical 4153716k(907500k free), swap 8305580k(3846420k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (23.1-b03) for windows-amd64 JRE (1.7.0_05-b06), built on Jun 27 2012 00:54:58 by "java_re" with unknown MS VC++:1600
time: Thu Aug 09 09:36:42 2012
elapsed time: 12 seconds
回答1:
This "exception" means you accessed a NULL value in C.
Can you checked all the types are unchanged in 64-bit?
Perhaps this works in 32-bit but fails to find the 64-bit version.
hJAWT = LoadLibraryW(path2);
Netbeans has a debugger which allows you to breakpoint in Java and C via JNI. This could help you find the exact line and perhaps why it happens.
回答2:
So interestingly, I'm actually working on a really similar application at the moment and having a really similar problem. I'm running a JAWT-based application on 64-bit Windows 7 and as soon as I try to have any code that utilizes the JAWT awt;
and beyond, it explodes. If you don't mind, try a couple things for me and we can verify if you're having the same problem (and if it's a Java thing or Windows thing, not an us thing):
- What happens if you remove all references to JAWT in your native code. Still call your native functions, but just remove all references to JAWT. This should cause the
jawt.lib
not to be linked in. In my experience, as soon as I removed all references to JAWT, my app stopped crashing. - What happens if you remove all references to your own stuff in your native code and do nothing but the basic JAWT initialization of getting a handle to
JAWT_Win32DrawingSurfaceInfo
? Does it still crash? In my experience, my code crashes even if the native code does nothing but initialize JAWT. - What happens if you run using JRE6 instead of JRE7? For my, my application crashes inmmediately in Java 7, but runs fine in Java 6.
Interested to hear if you see the same issues. I'm beginning to wonder if Java 7 for Windows 7 introduced some kind of regression. Still doing more testing. I'll post more results as I have them.
=========================================
UPDATE: New interesting wrinkle. It turns out that for me, just loading the DLL linked to jawt.lib with System.load(...) is enough. I don't even have to actually make a native call. It will still crash while rendering my Swing GUI.
来源:https://stackoverflow.com/questions/11885140/trying-to-use-jawt-on-64-bit-windows-7-os