Sunday, April 1, 2012

Re: JSNI error when using GWT canvas

You are running into a Chome/Dev mode bug that has apparently been around since about Chrome 10. It seems to be intermittent, only happens when stepping in and out of JSNI methods, and will not affect you application once it is compiled.

More information, discussion:
https://groups.google.com/forum/?fromgroups#!topic/google-web-toolkit/YHR-PiIqkaI
http://stackoverflow.com/questions/8913608/something-other-than-an-int-was-returned-from-jsni-method
http://code.google.com/p/google-web-toolkit/issues/detail?id=5778

On Friday, February 3, 2012 7:39:46 AM UTC-6, Karel wrote:
Hey guys,

I am getting quite random internal GWT errors when I am using the GWT
canvas widget in complex cases. Sometimes, seemingly random, JSNI
errors are fired such as:

com.google.gwt.dev.shell.HostedModeException: Something other than an
int was returned from JSNI method
'@com.google.gwt.dom.client.CanvasElement::getWidth()': JS value of
type JavaScript object(20511), 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.dom.client.CanvasElement$.getWidth$
(CanvasElement.java)
        at
com.google.gwt.canvas.client.Canvas.getCoordinateSpaceWidth(Canvas.java:
127)
         at...

These errors occur quite often, but do not seem to break anything.
They usually originate from a getCoordinateSpaceHeight() call on the
canvas. I tried digging in the debugger to find out what's wrong, but
the debugger does not cross the JSNI boundary, so I can't see what's
going on in javascript.

Anyone got any idea what is causing these errors?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/n7XRbooLHKgJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment