关于jdk1.5与Gxt-2.1.1的异常
GXT-2.1.1存在bug。
当通过new一个com.extjs.gxt.ui.client.widget.Window对象创建一个窗口组件时,控制台会报以下错误(我的jdk版本是1.5.0_06)。
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d7420c6, pid=3884, tid=656
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing)
# Problematic frame:
# V? [jvm.dll+0x620c6]
#
# An error report file with more information is saved as hs_err_pid3884.log
#
# If you would like to submit a bug report, please visit:
#?? http://java.sun.com/webapps/bugreport/crash.jsp
#
?
另外会在工程目录下生成一个很长的log文件,如下
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d7420c6, pid=3732, tid=3252
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing)
# Problematic frame:
# V? [jvm.dll+0x620c6]
#
---------------? T H R E A D? ---------------
Current thread (0x0cba9008):? JavaThread "Code server for com.mycompany.project.ImageViewer from Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; 360SE) on http://127.0.0.1:8888/ImageViewer.html?gwt.codesvr=127.0.0.1:9997 @ ZC..Z=YE37+a8L5T" daemon [_thread_in_vm, id=3252]
siginfo: ExceptionCode=0xc0000005, reading address 0x27868458
Registers:
EAX=0x000e9010, EBX=0x0cba9008, ECX=0x276d3118, EDX=0x2777f448
ESP=0x0c5ef094, EBP=0x0c5ef094, ESI=0x276d3118, EDI=0x276d38b8
EIP=0x6d7420c6, EFLAGS=0x00010202
Top of Stack: (sp=0x0c5ef094)
0x0c5ef094:?? 0c5ef0c4 6d7415a8 000000e9 00000000
0x0c5ef0a4:?? 6d74168a 000000e9 276d3118 6d77e42c
0x0c5ef0b4:?? 000000e9 00000000 0c5ef1d4 000000b6
0x0c5ef0c4:?? 0c5ef0fc 6d6b3aeb 0cba90c8 0c977f64
0x0c5ef0d4:?? 000000e9 00000015 0c5ef1d4 03066408
0x0c5ef0e4:?? 00000015 0c5ef1d4 000000b6 000000e9
0x0c5ef0f4:?? 00000000 00000000 0c5ef180 6d6b29de
0x0c5ef104:?? 00000000 00000000 0c5ef164 0c5ef1d4
Instructions: (pc=0x6d7420c6)
0x6d7420b6:?? 66 8b 45 08 86 c4 8b 51 10 0f b7 c0 40 c1 e0 04
0x6d7420c6:?? 8b 04 10 25 ff ff 00 00 eb 03 8b 45 08 8b 44 81
Stack: [0x0c5b0000,0x0c5f0000),? sp=0x0c5ef094,? free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V? [jvm.dll+0x620c6]
V? [jvm.dll+0x615a8]
C? [verify.dll+0x3aeb]
C? [verify.dll+0x29de]
C? [verify.dll+0x1aba]
C? [verify.dll+0x126b]
C? [java.dll+0x3fb7]
V? [jvm.dll+0x116063]
V? [jvm.dll+0x75e79]
V? [jvm.dll+0x7628d]
V? [jvm.dll+0x7628d]
V? [jvm.dll+0x7628d]
V? [jvm.dll+0x7628d]
V? [jvm.dll+0x76182]
V? [jvm.dll+0x75e58]
V? [jvm.dll+0x7ef8b]
j? com.mycompany.project.client.ImageViewer.onModuleLoad()V+4
v? ~StubRoutines::call_stub
V? [jvm.dll+0x845a9]
V? [jvm.dll+0xd9317]
V? [jvm.dll+0x8447a]
V? [jvm.dll+0xed13f]
V? [jvm.dll+0xa23ad]
C? [java.dll+0x6d11]
j? sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
J? sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
J? java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
v? ~RuntimeStub::alignment_frame_return Runtime1 stub
j? com.google.gwt.dev.shell.ModuleSpace.onLoad(Lcom/google/gwt/core/ext/TreeLogger;)V+296
j? com.google.gwt.dev.shell.OophmSessionHandler.loadModule(Lcom/google/gwt/dev/shell/BrowserChannel;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[B)Lcom/google/gwt/core/ext/TreeLogger;+128
j? com.google.gwt.dev.shell.BrowserChannelServer.processConnection()V+772
j? com.google.gwt.dev.shell.BrowserChannelServer.run()V+1
j? java.lang.Thread.run()V+11
v? ~StubRoutines::call_stub
V? [jvm.dll+0x845a9]
V? [jvm.dll+0xd9317]
V? [jvm.dll+0x8447a]
V? [jvm.dll+0x841d7]
V? [jvm.dll+0x9ed69]
V? [jvm.dll+0x109fe3]
V? [jvm.dll+0x109fb1]
C? [MSVCRT.dll+0x2a3b0]
C? [kernel32.dll+0xb729]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j? com.mycompany.project.client.ImageViewer.onModuleLoad()V+4
v? ~StubRoutines::call_stub
j? sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j? sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
J? sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
J? java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
v? ~RuntimeStub::alignment_frame_return Runtime1 stub
j? com.google.gwt.dev.shell.ModuleSpace.onLoad(Lcom/google/gwt/core/ext/TreeLogger;)V+296
j? com.google.gwt.dev.shell.OophmSessionHandler.loadModule(Lcom/google/gwt/dev/shell/BrowserChannel;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[B)Lcom/google/gwt/core/ext/TreeLogger;+128
j? com.google.gwt.dev.shell.BrowserChannelServer.processConnection()V+772
j? com.google.gwt.dev.shell.BrowserChannelServer.run()V+1
j? java.lang.Thread.run()V+11
v? ~StubRoutines::call_stub
---------------? P R O C E S S? ---------------
Java Threads: ( => current thread )
=>0x0cba9008 JavaThread "Code server for com.mycompany.project.ImageViewer from Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; 360SE) on http://127.0.0.1:8888/ImageViewer.html?gwt.codesvr=127.0.0.1:9997 @ ZC..Z=YE37+a8L5T" daemon [_thread_in_vm, id=3252]
? 0x0318ab20 JavaThread "btpool0-2" [_thread_blocked, id=2728]
? 0x03093808 JavaThread "TimerQueue" daemon [_thread_blocked, id=348]
? 0x0315f4c0 JavaThread "Timer-0" daemon [_thread_blocked, id=2508]
? 0x030ba310 JavaThread "btpool0-1 - Acceptor0 SelectChannelConnector@127.0.0.1:8888" [_thread_in_native, id=3176]
? 0x030b7e70 JavaThread "btpool0-0" [_thread_blocked, id=2372]
? 0x031739b0 JavaThread "Code server listener" daemon [_thread_in_native, id=448]
? 0x030790c8 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3672]
? 0x03071098 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=2168]
? 0x030b1650 JavaThread "AWT-Windows" daemon [_thread_in_native, id=660]
? 0x02ddcd40 JavaThread "AWT-Shutdown" [_thread_blocked, id=516]
? 0x00a7f838 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2192]
? 0x00a7e498 JavaThread "CompilerThread0" daemon [_thread_blocked, id=1248]
? 0x00a7d718 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=716]
? 0x00a57958 JavaThread "Finalizer" daemon [_thread_blocked, id=3172]
? 0x00a49ec0 JavaThread "Reference Handler" daemon [_thread_blocked, id=3728]
? 0x003c6d10 JavaThread "main" [_thread_blocked, id=268]
Other Threads:
? 0x003cf0f0 VMThread [id=1488]
? 0x00a80b80 WatcherThread [id=3000]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
?def new generation?? total 4736K, used 4283K [0x16ae0000, 0x17000000, 0x17e90000)
? eden space 4224K,? 95% used [0x16ae0000, 0x16eccc20, 0x16f00000)
? from space 512K,? 51% used [0x16f00000, 0x16f420a8, 0x16f80000)
? to?? space 512K,?? 0% used [0x16f80000, 0x16f80000, 0x17000000)
?tenured generation?? total 62452K, used 29739K [0x17e90000, 0x1bb8d000, 0x26ae0000)
?? the space 62452K,? 47% used [0x17e90000, 0x19b9ac70, 0x19b9ae00, 0x1bb8d000)
?compacting perm gen? total 13056K, used 12928K [0x26ae0000, 0x277a0000, 0x2aae0000)
?? the space 13056K,? 99% used [0x26ae0000, 0x277803e8, 0x27780400, 0x277a0000)
??? ro space 8192K,? 66% used [0x2aae0000, 0x2b03bcc0, 0x2b03be00, 0x2b2e0000)
??? rw space 12288K,? 46% used [0x2b2e0000, 0x2b882060, 0x2b882200, 0x2bee0000)
Dynamic libraries:
0x00400000 - 0x0040c000 ??? D:\Program Files\jdk\jdk1.5.0_06\bin\javaw.exe
0x7c920000 - 0x7c9b6000 ??? C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c91e000 ??? C:\WINDOWS\system32\kernel32.dll
0x77da0000 - 0x77e49000 ??? C:\WINDOWS\system32\ADVAPI32.dll
0x77e50000 - 0x77ee2000 ??? C:\WINDOWS\system32\RPCRT4.dll
0x77fc0000 - 0x77fd1000 ??? C:\WINDOWS\system32\Secur32.dll
0x77d10000 - 0x77da0000 ??? C:\WINDOWS\system32\USER32.dll
0x77ef0000 - 0x77f39000 ??? C:\WINDOWS\system32\GDI32.dll
0x77be0000 - 0x77c38000 ??? C:\WINDOWS\system32\MSVCRT.dll
0x76300000 - 0x7631d000 ??? C:\WINDOWS\system32\IMM32.DLL
0x62c20000 - 0x62c29000 ??? C:\WINDOWS\system32\LPK.DLL
0x73fa0000 - 0x7400b000 ??? C:\WINDOWS\system32\USP10.dll
0x6d6e0000 - 0x6d874000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\client\jvm.dll
0x76b10000 - 0x76b3a000 ??? C:\WINDOWS\system32\WINMM.dll
0x6d2f0000 - 0x6d2f8000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\hpi.dll
0x76bc0000 - 0x76bcb000 ??? C:\WINDOWS\system32\PSAPI.DLL
0x6d6b0000 - 0x6d6bc000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\verify.dll
0x6d370000 - 0x6d38d000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\java.dll
0x6d6d0000 - 0x6d6df000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\zip.dll
0x6d530000 - 0x6d543000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\net.dll
0x71a20000 - 0x71a37000 ??? C:\WINDOWS\system32\WS2_32.dll
0x71a10000 - 0x71a18000 ??? C:\WINDOWS\system32\WS2HELP.dll
0x6d070000 - 0x6d1d7000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\awt.dll
0x72f70000 - 0x72f96000 ??? C:\WINDOWS\system32\WINSPOOL.DRV
0x76990000 - 0x76acd000 ??? C:\WINDOWS\system32\ole32.dll
0x5adc0000 - 0x5adf7000 ??? C:\WINDOWS\system32\uxtheme.dll
0x736d0000 - 0x7371b000 ??? C:\WINDOWS\system32\ddraw.dll
0x73b30000 - 0x73b36000 ??? C:\WINDOWS\system32\DCIMAN32.dll
0x738b0000 - 0x73980000 ??? C:\WINDOWS\system32\D3DIM700.DLL
0x10000000 - 0x1005f000 ??? D:\Program Files\360\360Safe\safemon\safemon.dll
0x7d590000 - 0x7dd84000 ??? C:\WINDOWS\system32\SHELL32.dll
0x77f40000 - 0x77fb6000 ??? C:\WINDOWS\system32\SHLWAPI.dll
0x770f0000 - 0x7717b000 ??? C:\WINDOWS\system32\OLEAUT32.dll
0x77bd0000 - 0x77bd8000 ??? C:\WINDOWS\system32\VERSION.dll
0x762f0000 - 0x762f5000 ??? C:\WINDOWS\system32\MSIMG32.dll
0x75ff0000 - 0x76055000 ??? C:\WINDOWS\system32\MSVCP60.dll
0x3e410000 - 0x3e4e1000 ??? C:\WINDOWS\system32\WININET.dll
0x034b0000 - 0x034b9000 ??? C:\WINDOWS\system32\Normaliz.dll
0x3eab0000 - 0x3eaf5000 ??? C:\WINDOWS\system32\iertutil.dll
0x43ce0000 - 0x43e08000 ??? C:\WINDOWS\system32\urlmon.dll
0x77180000 - 0x77283000 ??? C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll
0x5d170000 - 0x5d20a000 ??? C:\WINDOWS\system32\comctl32.dll
0x74680000 - 0x746cc000 ??? C:\WINDOWS\system32\MSCTF.dll
0x73640000 - 0x7366e000 ??? C:\WINDOWS\system32\msctfime.ime
0x6d2b0000 - 0x6d2ed000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\fontmanager.dll
0x6d550000 - 0x6d559000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\nio.dll
0x03890000 - 0x038a6000 ??? D:\Program Files\Lingoes\Translator2\opentext2.dll
0x719c0000 - 0x719fe000 ??? C:\WINDOWS\system32\mswsock.dll
0x60fd0000 - 0x61025000 ??? C:\WINDOWS\system32\hnetcfg.dll
0x71a00000 - 0x71a08000 ??? C:\WINDOWS\System32\wshtcpip.dll
0x67600000 - 0x67609000 ??? D:\Program Files\Genuitec\Common\plugins\com.google.gwt.eclipse.sdkbundle.2.0.3_2.0.3.v201002191036\gwt-2.0.3\gwt-ll.dll
0x76eb0000 - 0x76eec000 ??? C:\WINDOWS\system32\RASAPI32.dll
0x76e60000 - 0x76e72000 ??? C:\WINDOWS\system32\rasman.dll
0x5fdd0000 - 0x5fe25000 ??? C:\WINDOWS\system32\NETAPI32.dll
0x76e80000 - 0x76eaf000 ??? C:\WINDOWS\system32\TAPI32.dll
0x76e50000 - 0x76e5e000 ??? C:\WINDOWS\system32\rtutils.dll
0x759d0000 - 0x75a7f000 ??? C:\WINDOWS\system32\USERENV.dll
0x77c40000 - 0x77c65000 ??? C:\WINDOWS\system32\msv1_0.dll
0x76760000 - 0x7676c000 ??? C:\WINDOWS\system32\cryptdll.dll
0x76d30000 - 0x76d48000 ??? C:\WINDOWS\system32\iphlpapi.dll
0x72240000 - 0x72245000 ??? C:\WINDOWS\system32\sensapi.dll
0x76f90000 - 0x76f96000 ??? C:\WINDOWS\system32\rasadhlp.dll
0x76ef0000 - 0x76f17000 ??? C:\WINDOWS\system32\DNSAPI.dll
0x16080000 - 0x16099000 ??? C:\Program Files\Bonjour\mdnsNSP.dll
0x68000000 - 0x68036000 ??? C:\WINDOWS\system32\rsaenh.dll
0x76f80000 - 0x76f88000 ??? C:\WINDOWS\System32\winrnr.dll
0x76f30000 - 0x76f5c000 ??? C:\WINDOWS\system32\WLDAP32.dll
0x74cc0000 - 0x74cde000 ??? C:\WINDOWS\system32\wshbth.dll
0x76060000 - 0x761b6000 ??? C:\WINDOWS\system32\SETUPAPI.dll
0x76d70000 - 0x76d92000 ??? C:\WINDOWS\system32\Apphelp.dll
0x6d200000 - 0x6d22f000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\cmm.dll
0x6d430000 - 0x6d44f000 ??? D:\Program Files\jdk\jdk1.5.0_06\jre\bin\jpeg.dll
VM Arguments:
jvm_args: -Xmx256m -Dfile.encoding=GBK
java_command: com.google.gwt.dev.DevMode -logLevel INFO -war war -startupUrl ImageViewer.html com.mycompany.project.ImageViewer
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=D:\Program Files\jdk\jdk1.5.0_06
PATH=d:/Program Files/Genuitec/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin/client;d:/Program Files/Genuitec/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin;D:\PROGRA~1\Borland\CBUILD~1\Bin;D:\PROGRA~1\Borland\CBUILD~1\Projects\Bpl;e:\oracle\product\10.2.0\db_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\Wireless\Bin\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;d:\Sun\AppServer\bin;d:\Program Files\StormII\Codec;d:\Program Files\StormII;D:\Program Files\apache-maven-2.2.1\bin;D:\Program Files\jdk\jdk1.5.0_06\bin
USERNAME=ERCHAOMA
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 10, GenuineIntel
---------------? S Y S T E M? ---------------
OS: Windows XP Build 2600 Service Pack 3
CPU:total 2 family 6, cmov, cx8, fxsr, mmx, sse, sse2, ht
Memory: 4k page, physical 1990608k(823084k free), swap 3928136k(2775500k free)
vm_info: Java HotSpot(TM) Client VM (1.5.0_06-b05) for windows-x86, built on Nov 10 2005 11:12:14 by "java_re" with MS VC++ 6.0
若换成jdk1.6就不会有以上问题。
经过google搜索,有个老外曾通过跟踪发现是在类加载时,一个布局(layout)类未加载引起,并给出一个解决方案。经试验可行,下面拿出来同大家分享:
在onModuleLoad()方法的开始,用jdk1.5注释的方法,将需要加载的布局类先忽略调。代码如下:
?
package com.mycompany.project.client;
import com.extjs.gxt.ui.client.widget.Layout;
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
/**
?* Entry point classes define <code>onModuleLoad()</code>.
?*/
public class ImageViewer implements EntryPoint {
??? public void onModuleLoad() {
??? ??? @SuppressWarnings("unused")
??? ??? Layout junk = new AnchorLayout();
??? ??? RootPanel rootPanel = RootPanel.get();
??? ???
??? ??? com.extjs.gxt.ui.client.widget.Window window = new com.extjs.gxt.ui.client.widget.Window();
??? ??? rootPanel.add(window);
??? ??? rootPanel.setWidgetPosition(window, 61, 37);
??? ??? window.setSize("300px", "200px");
??? }
}
?
这样就可以使用了。