开发者

How to know if an object is 'too large' for RPC in GWT and IE8?

开发者 https://www.devze.com 2023-01-24 15:11 出处:网络
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\'

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?

Bu开发者_StackOverflowt even so, the question remains - how do I know when it is 'small enough'?


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.


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:

  • http://code.google.com/webtoolkit/doc/latest/DevGuideCompileReport.html

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".


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号