<set-property name="compiler.stackMode" value="native" />
<set-property name="compiler.useSourceMaps" value="true"/>
<set-property name="compiler.emulatedStack" value="true" />
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers" value="true" />
<set-configuration-property name="compiler.emulatedStack.recordFileNames" value="true" />
and use StackTraceDeobfuscator to deobfuscate
private StackTraceDeobfuscator getStackTraceDeobfuscator(ServletContext servletContext) {
String relativeWebPath = "WEB-INF/deploy/appimpl/symbolMaps";
String symbolMapsDirectory = servletContext.getRealPath(relativeWebPath);
StackTraceDeobfuscator std = StackTraceDeobfuscator.fromFileSystem(symbolMapsDirectory);
return std;
}
which gives us this stack trace:
at java.lang.Throwable.Throwable(Throwable.java:58)
at java.lang.Exception.Exception(Exception.java:25)
at java.lang.RuntimeException.RuntimeException(RuntimeException.java:25)
at java.lang.NullPointerException.NullPointerException(NullPointerException.java:27)
at client.CustomMenu.simulateClientCrash(CustomMenu.java:3734) <--- first line of method
at client.CustomMenu$12.onClick(CustomMenu.java:1686)
..
The problem is that the trace always gives us the first line of the method and not the line where the exception is thrown.
CustomMenu.java
3734 private void simulateClientCrash() { <--- first line of method
3735 if (true) {
3736 throw new NullPointerException(); <--- exception is thrown
3737 }
3738 }
This is not a big deal if the method is short but can be quite a pain if the method is longer.
Why is this? Can it be fixed?
<set-property name="compiler.stackMode" value="emulated" />
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers" value="true" />
<set-configuration-property name="compiler.emulatedStack.recordFileNames" value="true" />
<set-property name="compiler.stackMode" value="native" />
In my experience, with "compiler.stackMode = native", even when using Chrome, you don't get line numbers. You have to have "compiler.stackMode = emulated".
In my experience, with "compiler.stackMode = native", even when using Chrome, you don't get line numbers. You have to have "compiler.stackMode = emulated".Today I have looked at a stack trace and it did show the correct line number when using Chrome. But the app uses GWT trunk and not a released GWT version, so maybe something changed and is currently broken in 2.8.2.-- J.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/35af2790-634c-40b6-a215-b48ee36a7422%40googlegroups.com.