On Thursday, September 22, 2011 8:51:10 PM UTC+2, Laura Bickle wrote:
>
> My app works in development mode, but does not work in production mode.  
>
> How do I debug in production mode?  I'm using the gwt plugin for eclipse.
>
> I tried googling "debugging in production mode gwt," but I'm still lost.  
> How do I:
> - set the -style compiler attribute in the eclipse plugin?
>

See Isaac's answer, linking to the GPE documentation.
 

> - create alert messages or read my print statements or something similar?
>

java.util.logging, possibly with RemoteLogging. See 
http://code.google.com/webtoolkit/doc/latest/DevGuideLogging.html
(the implementation is derived from gwt-log, and by the same author, as he's 
a Developer Advocate for GAE and GWT)

- verify that I'm not using any of these?  I don't think I am, but I also 
> think my code should work and it doesn't.  
>  - 
> http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsCompatibility.html


One key difference that's not listed there: do not rely on the exact type of 
the exceptions being thrown from emulated classes.
GWT privileges speed over "correctness" in cases when such correctness would 
hamper the application's performance. It's way better to check your 
arguments before calling a method, than to rely on a specific exception 
being thrown if/when the arguments are incorrect.
That being said, there are not that many differences in practice, but still.

- Is there a better way to find my problem?
>

You can use the symbolMaps files (I think you'll have to pass in the -extra 
argument to the compiler, with a path to a folder where to output the 
"extra" files) to map from obfuscated JS code to your Java code; and 
possibly the other way around to set a few breakpoints in the JS code (in 
Firebug for instance, or any other browser developer tool).
When you setup java.util.logging or gwt-log with remote logging, they can 
use those symbolMaps files to log deobfuscated stack traces. I think you 
have to enable emulated stack traces in your GWT app for this to work:
  <set-property name="compiler.emulatedStack" value="true"/>
  <set-configuration-property name="compiler.emulatedStack.recordFileNames" 
value="true" />
  <set-configuration-property 
name="compiler.emulatedStack.recordLineNumbers" value="true" />

You'd better make a distinct gwt.xml file to set those properties (along 
with the log level), so they don't impact your production app (use the same 
rename-to as your "production" gwt.xml, so you don't have to change your 
HTML host page).

-- 
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/-/t-ZNsbvw_xEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to