有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java 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中打开(使用UbuntuX64)时,我看到了以下内容

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,但没有用

谢谢大家


共 (1) 个答案

  1. # 1 楼答案

    虽然这不是最好的解决方案,但这是我想到的

    问题(如果您询问smartGWT)是GWT中的一个bug。这与GWT类的编译方式有关。基本答案是SmartGWT不能与maven gwt插件一起使用。我们可以绕过这个问题,但需要一个“mvn clean compile gwt:compile包”并将创建的jar部署到tomcat服务器

    我希望有一个更干净的解决方案,但这对我来说很有效