title: Unable to deobfuscate GWT stacktrace
body: <p>We are trying to send uncaught GWT exceptions (we are using GWT 2.5 rc1) to our server for logging and debugging purposes.  We want to deobfuscate the exception stack traces, otherwise it would be pretty much useless.</p>
  
  <p>After some investigations, I found <a href="http://www.summa-tech.com/blog/2012/06/11/7-tips-for-exception-handling-in-gwt/">7 Tips for Exception Handling in GWT</a> and <a href="http://code.google.com/p/google-web-toolkit/wiki/WebModeExceptions">WebModeExceptions</a> that contained valuable information.</p>
  
  <p>So we created a GWT UncaughtExceptionHandler that uses a custom RPC service to transfer the exceptions with their stack traces.  That works fine.</p>
  
  <p>As described in <a href="http://code.google.com/p/google-web-toolkit/wiki/WebModeExceptions#Resymbolization_/_Deobfuscation">WebModeExceptions deobfuscation section</a>, we enabled stacktrace emulation with this in our GWT module :</p>
  
  <pre><code>&lt;set-property name="compiler.stackMode" value="emulated" /&gt;
  &lt;set-configuration-property name="compiler.emulatedStack.recordLineNumbers"
      value="true" /&gt;
  </code></pre>
  
  <p>Now our stacktraces look like this :</p>
  
  <pre><code>com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot call method 'pp' of null
      Unknown.aT(Unknown Source:174)
      Unknown.AVa(Unknown Source:501)
      Unknown.YF(Unknown Source:29)
      Unknown.Lqb(Unknown Source:138)
      ...
  </code></pre>
  
  <p>It seems ok to me because it contains the obfuscated method name and the line number which seems to be what is needed as described in <a href="http://code.google.com/p/google-web-toolkit/wiki/WebModeExceptions#Resymbolization_/_Deobfuscation">WebModeExceptions deobfuscation section</a>.</p>
  
  <p>Then we compile our GWT modules with the -extra parameter to get the symbolmaps.</p>
  
  <p>Our custom log service uses the symbolMaps directory to invoke com.google.gwt.logging.server.StackTraceDeobfuscator.  We use X-GWT-Permutation http header to invoke the deobfuscator.  I stepped in the deobfuscate method to make sure it could load the symbol map.  It could.  I validated that the symbolMap file name used was matching the *.cache.js file name of the GWT module.  It does match.</p>
  
  <p>So basically, the service does this:</p>
  
  <pre><code>// Create the deobfuscator
  String dir = getSymbolMapsDirPath();
  StackTraceDeobfuscator deobfuscator = new StackTraceDeobfuscator(dir);
  
  // request is the HttpServletRequest
  String strongName = request.getHeader(RpcRequestBuilder.STRONG_NAME_HEADER);
  
  // Deobfuscate the stack trace
  exception.setStackTrace(
      deobfuscator.deobfuscateStackTrace(exception.getStackTrace(), strongName));
  
  // Log the exception
  logger.severe("Uncaught GWT exception", exception);
  </code></pre>
  
  <p>The end result is that the stack traces don't get deobfuscated.  Sometimes, some lines would get deobufscated with the wrong class and method name but nothing more.  When looking at the symbolMap file, the actual symbols in the stack trace don't match to any of the symbols in the symbolMap file.</p>
  
  <p>Any idea what we are doing wrong here?</p>
  
  <p><strong>EDIT: I tried RemoteLoggingServiceImpl and I get the same results.</strong></p>