JSNI error when using GWT canvas

103 views
Skip to first unread message

Karel

unread,
Feb 3, 2012, 8:39:46 AM2/3/12
to Google Web Toolkit
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?

hugues2

unread,
Mar 31, 2012, 12:50:03 AM3/31/12
to Google Web Toolkit
I have exactly the same issue. Hope this is related to the development
mode and not to the production mode.

On 3 fév, 15:39, Karel <karel.cromb...@gmail.com> 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

Colin Alworth

unread,
Apr 1, 2012, 1:02:43 PM4/1/12
to google-we...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages