从javascript堆栈跟踪中查找Java实际堆栈跟踪 [英] Finding the Java actual stack trace from a javascript stack trace

查看:89
本文介绍了从javascript堆栈跟踪中查找Java实际堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经实现了一个通用机制,可以从GWT客户端登录服务器异常。
当然,其中一些是意想不到的异常(例如NPE),因此我们在日志(摘录)中找到了一些堆栈跟踪:

 
java.lang.Throwable:捕获一个或多个异常,请参阅UmbrellaException中的全部集合Unknown.Hq(Unknown Source)处的$ getCauses
Unknown Unknown.ihb处的
(Unknown Source )在Unknown.anonymous(未知源)处
在Unknown.anonymous处(未知源)
在Unknown.anonymous(未知源)处

由java.lang.Throwable引起: (TypeError):d为空
stack:EG([object Object],[object Object])@http://domain/path/0B15791BA99231E6B88EAF3BDE38EB64.cache.html:3282

fileName :http://domain/path/0B15791BA99231E6B88EAF3BDE38EB64.cache.html
lineNumber:3282
at Unknown.EG(Unknown Source)
at Unknown.DG(未知来源)

如何在原始java源代码中找到类和行号?



我想要部署一个详细的编译版本,因为我没有关于确切场景的信息,我不能重现这个异常。

解决方案

GWT编译器在 -deploy -extra 位置的symbolMap文件中输出映射(其中 -deploy 默认为 -war WEB-INF / deploy -extra 默认情况下不会发出)。
手动使用它来从时间调试奇怪的事情您可以使用 最新的/ com / google / gwt / logging / server / StackTraceDeobfuscator.html> StackTraceDeobfuscator
FYI,此类使用 RemoteLoggingServiceImpl GW T-RPC servlet和 Logging RequestFactory服务;分别由 SimpleRemoteLogHandler RequestFactoryLogHandler (它们是 java.util.logging.LogHandler s您可以将它与GWT支持的日志API 一起使用。在这种情况下,它会查看webapp的 WEB-INF / deploy (这就是为什么 -deploy 默认值)。


We have implemented a general mechanism that logs on the server exceptions from the GWT client side. Naturally, some of them are unexpected exceptions (such as NPE), and therefore we are getting kind of these stack traces in our log (an excerpt):

java.lang.Throwable: One or more exceptions caught, see full set in UmbrellaException#getCauses
        at Unknown.Hq(Unknown Source)
        at Unknown.ihb(Unknown Source)
        at Unknown.anonymous(Unknown Source)
        at Unknown.anonymous(Unknown Source)
        at Unknown.anonymous(Unknown Source)
Caused by: java.lang.Throwable: (TypeError): d is null
stack: EG([object Object],[object Object])@http://domain/path/0B15791BA99231E6B88EAF3BDE38EB64.cache.html:3282

fileName: http://domain/path/0B15791BA99231E6B88EAF3BDE38EB64.cache.html
lineNumber: 3282
        at Unknown.EG(Unknown Source)
        at Unknown.DG(Unknown Source)

How can I find the class and line number in the original java source?

I don't want to deploy a detailed compiled version, since I don't have information about the exact scenario and I can't reproduce the exception.

解决方案

The GWT compiler outputs the mapping in symbolMap files in the -deploy and -extra locations (where -deploy defaults to the -war's WEB-INF/deploy, and -extra is not emitted by default).
I use it manually to debug weird things from time to time.

You can also deobfuscate traces programmatically, using the StackTraceDeobfuscator.
FYI, this class is used by the RemoteLoggingServiceImpl GWT-RPC servlet and the Logging RequestFactory service; respectively called by the SimpleRemoteLogHandler and RequestFactoryLogHandler (they're java.util.logging.LogHandlers which you can use with the logging API that GWT supports). In this case, it looks into the WEB-INF/deploy of the webapp (which is why -deploy defaults there).

这篇关于从javascript堆栈跟踪中查找Java实际堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆