当我使用 @JsType 时,GWT 2.8 出现经典开发模式错误 | @JsMethod 示例

GWT 2.8 with Classic Dev Mode error when I use @JsType | @JsMethod sample

我的框架项目有一个 EJB 架构设计,客户端 GWT2.7 + gwt-material 1.6 和 smartGWT 用于一些基于 maven 模型的小部件,我也使用经典开发模式(最适合我)工具调试,我对此没有任何问题,直到今天...

当我将 GWT2.7 升级到 2.8 时,我写了一个 @JsType 示例,我得到了下一个错误:

com.google.gwt.core.client.JavaScriptException: (null) @com.mypackage.MyApplication$SomeClassJsType::getName()([]): null

这里是 class:

@JsType(isNative=true, namespace = "com.cnames")
public class SomeClassJsType {
    @JsMethod
    public static native String getName();
}

这是我在 EntryPoint

中使用 class 的方式
rootPanel.add( new Label( SomeClassJsType.getName() ) );

这是 HTML 页面中的 javascript 片段

<body>
    <script type="text/javascript">
        com = { cnames: {} };
        com.cnames.SomeClassJsType = function () {
                this.name = "hello";    
        };
        com.cnames.SomeClassJsType.getName = function () {
                this.name = "world";    
        };      
    </script>
    <script type="text/javascript" language="javascript" src="Application/Application.nocache.js"></script>
</body>

我的目标是,在 Clasic Dev Mode 上调试我的项目。

为什么? 如果我将 GWT Material 1.6 升级到 2.0-rc2,我会收到下一个错误。

com.google.gwt.user.client.ui.AttachDetachException: Exception caught: 2 exceptions caught: Exception caught: (null) @gwt.material.design.client.js.JsMaterialElement::displayEffect()([]): null; Exception caught: (null) @gwt.material.design.client.js.JsMaterialElement::displayEffect()([]): null

而且我怀疑这是由于@JsType 注释造成的

有什么建议吗?

此致!

JsInterop 只能与 SuperDevMode 一起使用,遗留开发模式所需的所有字节码重写尚未实现(浪费时间用于仅在 select [=12] 中有效的已弃用功能=] 古老的浏览器)