如何知道一个对象是否“太大” GWT 和 IE8 中的 RPC?

发布于 2024-09-30 20:28:22 字数 373 浏览 2 评论 0原文

我有一个在 Firefox 中运行良好的应用程序,但当我在 IE8 中测试时,我收到一个奇怪的错误:'Stack Overflow at line: 0'

在 GWT 讨论组提出建议后,它可能是与从 RPC 调用返回的大型/复杂对象相关,我能够将问题范围缩小到我的 RPC 服务器调用之一,该调用确实返回了大型、复杂的对象。

如果错误确实是由于大型对象太大或太复杂造成的,我怎么知道这一点? “太大”的门槛在哪里?

GWT 讨论中的进一步评论表明 Collections 对象可能是问题所在,但这是来自另一位 GWT 开发人员的经验。 GWT 文档或团队是否在任何地方记录了此内容?

但即便如此,问题仍然存在——我如何知道它何时“足够小”?

I have an app that works fine in Firefox but when I tested in in IE8, I got a strange error : 'Stack overflow at line: 0'

After a suggestion from the GWT discussion group that it could be related to large/complex objects being returned from RPC calls, I was able to narrow down the problem to one of my RPC server calls which does return a large, complex object.

If it is true that the error is due to a large object being too large or complex, how do I know this? Where is the threshold of 'too large'?

Further comments from the GWT discussion indicate that Collections objects are likely the problem, but this is from another GWT developer's experience. Is this documented anywhere by the GWT docs or team?

But even so, the question remains - how do I know when it is 'small enough'?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

抹茶夏天i‖ 2024-10-07 20:28:22

我仍然不知道有关对象大小的指定问题是否有答案,但我的问题最终是因为我在返回的对象中递归引用了其他对象。好吧,不是显式递归,而是对象 A 中对对象 B 的引用,对象 B 又引用了对象 A,等等。这是一个家谱结构,因此每个个体都有关系图,其中包含对其他相关个体的引用,这些个体也有引用返回到相关个人等。在内存中工作正常,引用同一对象,但显然 GWT 为 IE 生成的 javascript 无法正确反序列化它。

I still don't know if there's an answer to the specified question about the size of an object, but my problem ended up being because I had recursive references to other objects in the object I was returning. Well, not recursive explicitly, but references in object A to object B which referenced object A, etc. etc. It was a family tree structure so there were maps of relationships for each individual, which held references to other related individuals, which had references back to the related individual, etc. Works fine in memory, with the references to the same object, but apparently the javascript that GWT generated for IE couldn't deserialize it properly.

挽容 2024-10-07 20:28:22

解决此问题的最佳方法是在编译 GWT 代码时使用 -compileReport 标志,这里有开发人员指南和一些示例:

我已经在 GWT 1.6.x 和 2 的 ant 脚本中使用了它.x。

PS:不知道您正在使用哪个版本的 GWT,我无法真正提供任何更有用的东西。但是,如果您使用的是 2.1 之前的版本,则可能需要注意 - 因为他们引入了 数据呈现小部件可能会解决您的对象“太大”的问题。

The best way to troubleshoot this would be to use the -compileReport flag when compiling your GWT code, there's a developer's guide and some samples available here:

I've used it within an ant script with GWT 1.6.x and 2.x.

PS: Not knowing which version of GWT you're working with I can't really provide anything more useful. However, it might be something to note if you're using anything older than 2.1 -- because they introduced Data Presentation Widgets which could possibly solve your issues of objects that are "too big".

天煞孤星 2024-10-07 20:28:22

加载我的 GWT 页面时,我还收到“Stack Overflow at line: 0”。最后,在我的例子中,应用程序仅在使用 Eclipse 调试模式 url(包括 ?gwt.codesvr=127.0.0.1:9997 代码段)时才会抱怨。删除 URL 中的该片段后,错误就消失了。

I also was getting 'Stack overflow at line: 0' when loading my GWT page. Ends up that in my case, the app only complained when using the Eclipse debug mode url including the ?gwt.codesvr=127.0.0.1:9997 snippet. After removing that snippet in the URL, the error went away.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文