【发布时间】:2012-01-31 22:22:48
【问题描述】:
我正在尝试使用 Maven 和 SmartGWT 创建一个 GWT 项目。我制作的 GWT 模块运行良好,因此我尝试为 SmartGWT 创建以下入口点。
@Override
public void onModuleLoad() {
final DynamicForm form = new DynamicForm();
form.setWidth(500);
form.setNumCols(4);
ComboBoxItem bugStatusItem = new ComboBoxItem("bugStatus");
bugStatusItem.setTitle("Bug Status");
LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
valueMap.put("new", "New");
valueMap.put("active", "Active");
valueMap.put("revisit", "Revisit");
valueMap.put("fixed", "Fixed");
valueMap.put("delivered", "Delivered");
valueMap.put("resolved", "Resolved");
valueMap.put("reopened", "Reopened");
bugStatusItem.setValueMap(valueMap);
form.setItems(bugStatusItem);
form.draw();
}
但是当我在 Chrome 中打开时(使用 ubuntu x64),我看到以下内容...
http://127.0.0.1:8888/Header.html:
GWT module 'com.gleason.ecommerce.textmanagement.gwt.Header' may need to be (re)compiled
http://127.0.0.1:8888/Header.html?gwt.codesvr=127.0.0.1:9997
00:19:55.205 [ERROR] Unable to load module entry point class
com.smartgwt.client.SmartGwtEntryPoint (see associated exception for details)
com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot read property 'Browser' of undefined at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248) at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) at
com.smartgwt.client.SmartGwtEntryPoint.init(SmartGwtEntryPoint.java) at
com.smartgwt.client.SmartGwtEntryPoint.onModuleLoad(SmartGwtEntryPoint.java:239) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at
java.lang.reflect.Method.invoke(Method.java:597) at
com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525) at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at
java.lang.Thread.run(Thread.java:662)
我尝试了 gwt:compile,但没有帮助。
谢谢各位!
【问题讨论】:
-
我有 mvndependecy:tree 但是当我尝试发布时它总是失败
-
您提供的第一个链接用于在编译模式下运行项目,第二个链接用于在开发模式下运行项目。当您使用第二个链接运行项目时,您不应该遇到第一个异常。对吗?
-
那是正确的,另外我没有说清楚的是,如果我使用常规的 GWT 入口点(没有 SmarGWT 类)一切正常。