GWT无法创建XML元素

时间:2022-10-20 18:50:14

I'm creating a XML structure basically like this one: Create XML document on GWT client side (first anser).

我正在创建一个基本上像这样的XML结构:在GWT客户端创建XML文档(第一个anser)。

It works fine in 99% of the cases but sometimes, after running for a while, it randomly fails with the follwoing messages:

它在99%的情况下都能正常工作,但有时候,在运行一段时间之后,它随机地失败并显示以下消息:

com.google.gwt.dev.shell.HostedModeException: Something other than a short was returned from JSNI method '@com.google.gwt.xml.client.impl.XMLParserImpl::getNodeType(Lcom/google/gwt/core/client/JavaScriptObject;)': JS value of type JavaScript object(2608), expected short at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266) at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:154) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeShort(ModuleSpace.java:279) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeShort(JavaScriptHost.java:99) at com.google.gwt.xml.client.impl.XMLParserImpl.getNodeType(XMLParserImpl.java) at com.google.gwt.xml.client.impl.NodeImpl.build(NodeImpl.java:41) at com.google.gwt.xml.client.impl.NodeImpl.appendChild(NodeImpl.java:82)

com.google.gwt.dev.shell.HostedModeException:从JSNI方法'@ com.google.gwt.xml.client.impl.XMLParserImpl :: getNodeType(Lcom / google / gwt / core / client)返回了一个short以外的东西/ JavaScriptObject;)':JavaScript对象类型的JS值(2608),预期在com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)的com.google.gwt.dev.shell短。 JsValueGlue.get(JsValueGlue.java:154)位于com.google.gwt.dev.shell.ModuleSpace.invokeNativeShort(ModuleSpace.java:279)com.google.gwt.dev.shell.JavaScriptHost.invokeNativeShort(JavaScriptHost.java: 99)com.google.gwt.xml.client.impl.XMLParserImpl.getNodeType(XMLParserImpl.java)com.google.gwt.xml.client.impl.NodeImpl.build(NodeImpl.java:41)com.google .gwt.xml.client.impl.NodeImpl.appendChild(NodeImpl.java:82)

It's not at the same element but could be at any elment, even after it create 3 of the same kind successfully before.

它不是同一个元素,但可以在任何元素,即使它之前成功创建了3个相同类型。

Is that a known problem and does it only happen in debugg mode?

这是一个已知问题,它只发生在调试模式吗?

1 个解决方案

#1


1  

Seen this error many times, i have feeling it has something to do with how classes are reloaded in GWT dev mode. Never seen it to happen on production mode. There are some other cases when this error can appear(like using window.alert in JSNI), but most of the time it only means that you have to restart dev mode.

多次看到这个错误,我觉得它与如何在GWT开发模式下重新加载类有关。从未见过它会在生产模式上发生。还有一些其他情况可能会出现此错误(例如在JSNI中使用window.alert),但大多数情况下它只意味着您必须重新启动开发模式。

#1


1  

Seen this error many times, i have feeling it has something to do with how classes are reloaded in GWT dev mode. Never seen it to happen on production mode. There are some other cases when this error can appear(like using window.alert in JSNI), but most of the time it only means that you have to restart dev mode.

多次看到这个错误,我觉得它与如何在GWT开发模式下重新加载类有关。从未见过它会在生产模式上发生。还有一些其他情况可能会出现此错误(例如在JSNI中使用window.alert),但大多数情况下它只意味着您必须重新启动开发模式。