SmartGWT 无法与 Maven 和 Jetty Chrome Ubuntu x64 一起使用
我正在尝试使用 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,但没有帮助。
谢谢你们!
I am trying to create a GWT project using Maven and SmartGWT. The GWT module I made worked fines so I tried creating the following EntryPoint for 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();
}
But when I open up in Chrome (using ubuntu x64) I see the following...
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)
I have tried a gwt:compile, that didn't help.
Thanks Guys!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然这不是最好的解决方案,但这是我想出的。
这个问题(如果你问 smartGWT)是 GWT 中的一个错误。这与 GWT 类的编译方式有关。基本答案是 SmartGWT 不能与 maven gwt 插件一起使用。人们可以解决这个问题,但可以使用“mvn cleancompile gwt:compile package”并将创建的 jar 部署到 tomcat 服务器。
我希望有一个更清洁的解决方案,但这对我有用。
Although this is NOT the best solution here is what I came up with.
The problem (if you ask smartGWT) is a bug in GWT. This has something to do with the way the GWT classes are compiled. The essential answer is SmartGWT cannot be used with the maven gwt plugin. One can get around this but a "mvn clean compile gwt:compile package" and deploying the created jar to a tomcat server.
I wish there was a cleaner solution but this worked for me.