<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" />
you will only get the line number of your method declaration (but not the exact line inside the method).
On Wednesday, June 19, 2019 at 12:19:30 AM UTC+10, Carl wrote:
We use source maps to log stack traces from the GWT client on the server<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?
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-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/a3b5408b-438a-4000-b14c-c9a690c57415%40googlegroups.com.
No comments:
Post a Comment