自从6月以来,我成功地切换到了 GWT 2.6.1 和 SuperDevMode,相比于 简单的 DevMode,提供了相当不错的体验并且更加容易使用。
然而,我发现我的堆栈跟踪信息在服务器上无法正确反混淆。即使进行了反混淆,我仍然收到混淆的堆栈跟踪信息。
下面是相关的 *.gwt.xml 文件内容:
<module rename-to="somemodule">
<!-- inherits, stylesheet, entry-point, source elements are going here -->
<add-linker name="xsiframe" />
<extend-property name="locale" values="uk" />
<set-property-fallback name="locale" value="uk" />
<set-property name="compiler.stackMode" value="emulated" />
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers" value="true" />
<set-property name="gwt.logging.logLevel" value="INFO" />
<set-property name="gwt.logging.enabled" value="TRUE" />
<set-property name="gwt.logging.developmentModeHandler" value="ENABLED" />
<set-property name="gwt.logging.systemHandler" value="DISABLED" />
<set-property name="gwt.logging.popupHandler" value="DISABLED" />
<set-property name="gwt.logging.consoleHandler" value="ENABLED" />
<set-property name="gwt.logging.firebugHandler" value="ENABLED" />
</module>
以下是处理客户端异常的服务器端代码:
import static com.google.gwt.user.client.rpc.RpcRequestBuilder.STRONG_NAME_HEADER;
import com.google.gwt.core.client.impl.SerializableThrowable;
import com.google.gwt.logging.server.StackTraceDeobfuscator;
// ....
@Override
public void logClientException(final SerializableThrowable ex, final String userAgent, final String platform, final String moduleName) {
final HttpServletRequest request = getThreadLocalRequest();
final String symbolMapsDirectory = "webapps/" + getTomcatWebappFolder(request.getServletContext()) + "/WEB-INF/deploy/" + moduleName + "/symbolMaps";
final String permutationName = request.getHeader(STRONG_NAME_HEADER);
final Throwable original = new StackTraceDeobfuscator(symbolMapsDirectory).deobfuscateThrowable(ex.getThrowable(), permutationName);
logClientException(original, userAgent, platform);
}
从 GWT 2.5.1 转移到 GWT 2.6.1 时,我是否忽略了一些内容?
非常感谢您提前的帮助!