0
我想創建一些簡單的GWT + GXT應用程序。爲什麼會出現GXT異常以及如何解決它?
- GWT是2.6.1
- GXT是3.1.0
我創建簡單的類 MySampleApplication.java
:
public class MySampleApplication implements EntryPoint {
public void onModuleLoad() {
AlertMessageBox d = new AlertMessageBox("title", "message");
d.show();
}
}
和簡單聲明MySampleApplication.gwt.xml
:
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.sencha.gxt.ui.GXT'/>
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<stylesheet src="reset.css" />
<entry-point class='com.mySampleApplication.client.MySampleApplication'/>
看起來沒有什麼更容易,但它失敗:
onModuleLoad() threw an exception
Exception while loading module com.mySampleApplication.client.MySampleApplication.
See Development Mode for details.
java.lang.reflect.InvocationTargetException at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at
java.lang.reflect.Method.invoke(Method.java:483) at
com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:411) at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ExceptionInInitializerError at com.mySampleApplication.client.MySampleApplication.onModuleLoad(MySampleApplication.java:9) ... 9 more
Caused by:
java.lang.RuntimeException: Deferred binding failed for
'com.sencha.gxt.widget.core.client.box.MessageBox$MessageBoxIcons'
(did you forget to inherit a required module?) at
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53) at
com.google.gwt.core.shared.GWT.create(GWT.java:72) at
com.google.gwt.core.client.GWT.create(GWT.java:86) at
com.sencha.gxt.widget.core.client.box.MessageBox.<clinit>(MessageBox.java:57) ... 10 more Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:610) at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:470) at
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) ... 13 more
刪除單元緩存和檢查,如果你有沒有舊GWT罐子你類路徑。檢查你的代碼。它運行。 – 2014-10-20 10:55:27