简体   繁体   English

从JSNI方法返回除int之外的东西

[英]Something other than an int was returned from JSNI method

I am running a GWT application in hosted mode. 我正在托管模式下运行GWT应用程序。 Sporadically I get a strange HostedModeException complaining about the type of the JS value returned from JSNI. 偶尔我会得到一个奇怪的HostedModeException抱怨从JSNI返回的JS值的类型。 Sometimes it is during deserialization: 有时它是在反序列化期间:

 com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader::readInt()': JS value of type boolean, expected int
    at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:247)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:75)
    at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.readInt(ClientSerializationStreamReader.java)

sometimes at: 有时在:

 com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.google.gwt.user.client.impl.DOMImpl::eventGetTypeInt(Ljava/lang/String;)': JS value of type null, expected int
    at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:247)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:75)
    at com.google.gwt.user.client.impl.DOMImpl.eventGetTypeInt(DOMImpl.java)
    at com.google.gwt.user.client.impl.DOMImpl.eventGetTypeInt(DOMImpl.java:62)
    at com.google.gwt.user.client.DOM.eventGetType(DOM.java:602)
    at com.google.gwt.user.client.Event$.getTypeInt$(Event.java:695)
    at com.extjs.gxt.ui.client.util.BaseEventPreview.onPreviewNativeEvent(BaseEventPreview.java:139)

once again at 再一次

com.google.gwt.dev.shell.HostedModeException: Something other than a float was returned from JSNI method '@com.extjs.gxt.ui.client.util.Util::parseFloat(Ljava/lang/String;F)': JS value of type boolean, expected float
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:118)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeFloat(ModuleSpace.java:235)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeFloat(JavaScriptHost.java:67)
    at com.extjs.gxt.ui.client.util.Util.parseFloat(Util.java)
    at com.extjs.gxt.ui.client.core.El.getFrameSize(El.java:1081)
    at com.extjs.gxt.ui.client.core.El.setSize(El.java:2702)
    at com.extjs.gxt.ui.client.widget.BoxComponent.setSize(BoxComponent.java:501)
    at com.extjs.gxt.ui.client.widget.BoxComponent.setHeight(BoxComponent.java:320)

Can anyone help me on this? 谁可以帮我这个事? I am using GWT 2.4.0, Google Chrome 16.0.912.75 and GWT Developer Plugin 1.0.9738. 我使用的是GWT 2.4.0,谷歌浏览器16.0.912.75和GWT Developer Plugin 1.0.9738。

For some magical reason chrome works very badly with GWT DevMode. 由于一些神奇的原因,chrome与GWT DevMode的工作非常糟糕。 Random null pointer exception while parsing JSON, JSNI return types errors when working with GXT, remote death exceptions are a very common problems. 在解析JSON时,随机空指针异常,JSNI在使用GXT时返回类型错误,远程死亡异常是一个非常常见的问题。 It is known problem and that's why most people are not using GWT DevMode with Chrome. 这是众所周知的问题,这就是为什么大多数人都没有在Chrome中使用GWT DevMode。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM