JavaScriptException: (NS_ERROR_DOM_SYNTAX_ERR): An invalid or illegal string was specified

148 views
Skip to first unread message

Harald Schilly

unread,
Jun 16, 2011, 11:43:00 AM6/16/11
to google-we...@googlegroups.com
Hi, I'm getting this error in OOPHM and I have no idea how to track down its cause. It works in a previous revision and when I look into the diff I can't find anything suspicious. Is there a way to further track down where the problem is? (GWT 2.3)

17:40:54.551 [ERROR] [k3] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (NS_ERROR_DOM_SYNTAX_ERR): An invalid or illegal string was specified
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:662)

Thomas Broyer

unread,
Jun 16, 2011, 11:52:09 AM6/16/11
to google-we...@googlegroups.com
When facing JavaScriptException in DevMode:
  1. open Firebug / Web Inspector / Developer Tools
  2. enable "break on exception" in the JS console
  3. the browser should then stop at the exception and allow you to look at the snippet of code that caused it; there should be enough information there to point you to the corresponding JSNI method
Alternately, I guess you might be able to find that same information by setting a breakpoint in BrowserchannelServer#invokeJavaScript

Harald Schilly

unread,
Jun 16, 2011, 1:20:16 PM6/16/11
to google-we...@googlegroups.com
On Thu, Jun 16, 2011 at 17:52, Thomas Broyer <t.br...@gmail.com> wrote:
> the browser should then stop at the exception and allow you to look at the
> snippet of code that caused it; there should be enough information there to
> point you to the corresponding JSNI method

Thanks for the fast reply. Ok, I tried that, did only work when
working with the compiled JS. Compiled as "detailed" it breaks here:

function com_google_gwt_core_client_impl_StackTraceCreator$Collector_$makeException__Lcom_google_gwt_core_client_impl_StackTraceCreator$Collector_2Lcom_google_gwt_core_client_JavaScriptObject_2(){
try {
null.a();
}
catch (e) {
return e;
}
}

at the "null.a();". All code above in the stack is not from me and
part of the framework -- but i don't really get it and that wasn't too
helpful.

Actually, setting a breakpoint inside that JS-Exception and
investigating the arguments revealed it. I was calling "arc(...)" on a
Context2D of a canvas element and the arguments were arc(2.0, NaN,
...) and well, that won't work. Better stacktrace would have been
helpful, though.

H

Reply all
Reply to author
Forward
0 new messages