fredsa / forplay

Automatically exported from code.google.com/p/forplay
Apache License 2.0
12 stars 4 forks source link

Can't debug the html version on any samples #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Peas Sample(Eclipse) -> Run as Web Application -> Peas.html

What is the expected output? What do you see instead?
Eclipse Console:

Linking modules
   Bootstrap link for command-line module 'forplay.sample.peas.PeasFlash'
      Linking module 'peasflash'
         Invoking Linker FlexCompiler
            FlexCompiler home is /home/build/google3/third_party/flex4_sdk
            Writing com/adobe/images/BitString.as
            Writing com/adobe/images/JPGEncoder.as
            Writing com/adobe/images/PNGEncoder.as
            Writing com/googlecode/flashcanvas/Base64.as
            Writing com/googlecode/flashcanvas/CSSColor.as
            Writing com/googlecode/flashcanvas/Canvas.as
            Writing com/googlecode/flashcanvas/CanvasGradient.as
            Writing com/googlecode/flashcanvas/CanvasPattern.as
            Writing com/googlecode/flashcanvas/CanvasPixelArray.as
            Writing com/googlecode/flashcanvas/CanvasRenderingContext2D.as
            Writing com/googlecode/flashcanvas/ColorStop.as
            Writing com/googlecode/flashcanvas/Config.as
            Writing com/googlecode/flashcanvas/GraphicsPathCommand.as
            Writing com/googlecode/flashcanvas/Image.as
            Writing com/googlecode/flashcanvas/ImageData.as
            Writing com/googlecode/flashcanvas/LinearGradient.as
            Writing com/googlecode/flashcanvas/Path.as
            Writing com/googlecode/flashcanvas/RadialGradient.as
            Writing com/googlecode/flashcanvas/State.as
            Writing com/googlecode/flashcanvas/TextMetrics.as
[WARN] 404 - GET /cutegame/appcache.nocache.manifest (127.0.0.1) 1420 bytes
   Request headers
      Host: 127.0.0.1:8888
      Connection: keep-alive
      User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.71 Safari/534.24
      Accept-Encoding: gzip,deflate,sdch
      Accept-Language: en-US,en;q=0.8,ro;q=0.6
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
   Response headers
      Content-Type: text/html; charset=iso-8859-1
      Content-Length: 1420
(HtmlLog.java:37) 2011-05-29 22:00:01,343 [DEBUG] Preferred sound type: 
com.allen_sauer.gwt.voices.client.FlashSound
(HtmlLog.java:37) 2011-05-29 22:00:01,378 [DEBUG] Analytics random = 0.6256938
(HtmlLog.java:47) 2011-05-29 22:00:01,445 [INFO ] Failed to create GL context. 
Falling back.
Removing 'com.allen_sauer.gwt.log.client.ConsoleLogger' due to unexecpted 
exceptioncom.google.gwt.core.client.JavaScriptException: (String): invoke of 
@com.allen_sauer.gwt.log.client.ConsoleLogger::logMessage(ILjava/lang/String;) 
failed
    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.invokeNativeVoid(ModuleSpace.java:289)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.allen_sauer.gwt.log.client.ConsoleLogger.logMessage(ConsoleLogger.java)
    at com.allen_sauer.gwt.log.client.ConsoleLogger.log(ConsoleLogger.java:56)
    at com.allen_sauer.gwt.log.client.RemoteLogger.loggersLog(RemoteLogger.java:88)
    at com.allen_sauer.gwt.log.client.impl.LogImplBase.sendToLoggers(LogImplBase.java:247)
    at com.allen_sauer.gwt.log.client.impl.LogImplBase.log(LogImplBase.java:298)
    at com.allen_sauer.gwt.log.client.impl.LogImplBase.info(LogImplBase.java:177)
    at com.allen_sauer.gwt.log.client.Log.info(Log.java:605)
    at com.allen_sauer.gwt.log.client.Log.info(Log.java:503)
    at forplay.html.HtmlLog.info(HtmlLog.java:47)
    at forplay.html.HtmlPlatform.run(HtmlPlatform.java:193)
    at forplay.core.ForPlay.run(ForPlay.java:143)
    at forplay.sample.peas.html.PeasHtml.start(PeasHtml.java:31)
    at forplay.html.HtmlGame$1.execute(HtmlGame.java:25)
    at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50)
    at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:229)
    at com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(SchedulerImpl.java:389)
    at com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java:78)
    at com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:139)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    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.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    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:619)
(DOMImpl.java:-1) 2011-05-29 22:00:01,449 [FATAL] Uncaught Exception:
com.google.gwt.core.client.JavaScriptException: (String): invoke of 
@com.google.gwt.dom.client.DOMImpl::createElement(Lcom/google/gwt/dom/client/Doc
ument;Ljava/lang/String;) failed
    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.dom.client.DOMImpl.createElement(DOMImpl.java)
    at com.google.gwt.dom.client.Document$.createCanvasElement$(Document.java:151)
    at forplay.html.HtmlGraphics.<init>(HtmlGraphics.java:65)
    at forplay.html.HtmlGraphicsDom.<init>(HtmlGraphicsDom.java:31)
    at forplay.html.HtmlPlatform.run(HtmlPlatform.java:194)
    at forplay.core.ForPlay.run(ForPlay.java:143)
    at forplay.sample.peas.html.PeasHtml.start(PeasHtml.java:31)
    at forplay.html.HtmlGame$1.execute(HtmlGame.java:25)
    at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50)
    at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:229)
    at com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(SchedulerImpl.java:389)
    at com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java:78)
    at com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:139)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    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.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    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:619)

Chrome Console:
Creating Application Cache with manifest 
http://127.0.0.1:8888/cutegame/appcache.nocache.manifest
Application Cache Checking event
Application Cache Error event: Manifest fetch failed (404) 
http://127.0.0.1:8888/cutegame/appcache.nocache.manifest
(HtmlLog.java:37) 2011-05-29 21:47:36,792 [DEBUG] Preferred sound type: 
com.allen_sauer.gwt.voices.client.FlashSound
(HtmlLog.java:37) 2011-05-29 21:47:36,815 [DEBUG] Analytics random = 0.5979258
Uncaught Error: Error calling method on NPObject.
Peas.html:3Uncaught ReferenceError: NPObject deleted
Peas.html:4Uncaught ReferenceError: NPObject deleted

What version of the product are you using? On what operating system?
Win 64

Please provide any additional information below.

Chrome shows only a black background.
This is my first gwt try so maybe I'm doing something wrong.

Original issue reported on code.google.com by vladt...@gmail.com on 29 May 2011 at 7:01

GoogleCodeExporter commented 9 years ago
Forgot to add that the compiled version works.

Original comment by vladt...@gmail.com on 29 May 2011 at 7:03

GoogleCodeExporter commented 9 years ago
I can confirm this exception. Looking into it...

Original comment by pdr@google.com on 29 May 2011 at 8:36

GoogleCodeExporter commented 9 years ago
Should be fixed with http://code.google.com/p/forplay/source/detail?r=109

Side note: Not to keep bringing this up, but 
com.allen_sauer.gwt.log.client.ConsoleLogger causes the error this user 
received to be unreadable to the average user. Instead of getting an error 
about createElement failing, they got 50 lines about a javascript exception in 
ConsoleLogger. Removing all the console logging modifications and returning 
logging to just "System.out.println()", the true error was easy to locate.

Original comment by pdr@google.com on 29 May 2011 at 9:41

GoogleCodeExporter commented 9 years ago
Thanks for fixing this.

I filed a bug for the underlying development mode issue we tickled by 
inadvertently calling RootPanel.getBodyElement().setInnerHTML("") here:
  http://code.google.com/p/google-web-toolkit/issues/detail?id=6419

--------------------------------

Side note reply:
I agree wholeheartedly that gwt-log should not make it harder to find bugs. If 
it ever does, you can and should yell at me :)

In this case, had we not used gwt-log at all, then HtmlLog's info() method 
would've likely been a simple JSNI method that looked something like this:
  public native void info(String msg) /*-{
    console.debug(msg);
  }-*/;

The above GWT bug 
(http://code.google.com/p/google-web-toolkit/issues/detail?id=6419) would've 
prevented that JSNI method from executing in development mode. The GWT 
development console would've equally uselessly read:

23:00:07.305 [ERROR] [peas] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (String): invoke of 
@forplay.html.HtmlLog::info(Ljava/lang/String;) failed
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at forplay.html.HtmlLog.info(HtmlLog.java)
    at forplay.html.HtmlPlatform.run(HtmlPlatform.java:193)
    at forplay.core.ForPlay.run(ForPlay.java:143)
    at forplay.sample.peas.html.PeasHtml.start(PeasHtml.java:31)
    at forplay.html.HtmlGame$1.execute(HtmlGame.java:25)
    at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50)
    at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:228)
    at com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(SchedulerImpl.java:388)
    at com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java:78)
    at com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:138)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:613)
    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:171)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    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:213)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:613)
    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:171)
    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:722)

So, after setting body.innerHTML='', all Java methods, including 
System.out/err.println() still work, but development mode no longer knows how 
to do anything in JSNI, breaking all communication with the browser, including 
preventing logging to the browser's console, calling $wnd.alert(), etc.

(We should probably move the side note discussion to the discussion list 
https://groups.google.com/forum/#!forum/gwt-forplay going forward)

Original comment by fredsa@google.com on 30 May 2011 at 6:14