如何在eclipse上显示完整的堆栈跟踪? [英] How to show full stack trace on eclipse?

查看:420
本文介绍了如何在eclipse上显示完整的堆栈跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse调试Java应用程序。在代码的某个地方我得到一个异常和堆栈跟踪:

 导致:java.io.EOFException:连接已经在com.gemstone.gemfire.internal.cache.tier.sockets.Message.fetchHeader(Message.java:583)上阅读头文件
时重置
at com.gemstone.gemfire.internal.cache.tier .sockets.Message.readHeaderAndPayload(Message.java:599)
在com.gemstone.gemfire.internal.cache.tier.sockets.Message.read(Message.java:542)
在com.gemstone .gemfire.internal.cache.tier.sockets.Message.recv(Message.java:1029)
at com.gemstone.gemfire.cache.client.internal.AbstractOp.attemptReadResponse(AbstractOp.java:158)
at com.gemstone.gemfire.cache.client.internal.AbstractOp.attempt(AbstractOp.java:363)
at com.gemstone.gemfire.cache.client.internal.ConnectionImpl.execute(ConnectionImpl.java: 229)
at com.gemstone.gemfire.cache.client.internal.pooling.PooledConnection.execute(PooledConnection.java:321)
at com.rar b $ b ... 11更多

如何获取整个堆栈而不是 ... 11更多

解决方案

整个堆栈。



这只是堆栈跟踪的一部分。在这之前就是另一件事。看看这一行的底线,和前一行的顶行。你会看到他们匹配。堆栈跟踪开始于一个不以Caused by开头的部分。



引起的异常是隐藏堆栈跟踪中的逐字副本的部分的堆栈跟踪条目在其父。换句话说,Java不会为每个原因显示整个堆栈到main() - 它只是显示你还没有看到。请参阅 Throwable.printStackTrace()文档



当您在创建Throwable时提供了一个原因,Caused by被填满。看看它的构造函数。这是在一段代码捕获低级异常然后想要作为其他异常类重新抛出的时候完成的。


I'm using Eclipse to debug a Java application. Somewhere in the code I get an exception and the stack trace:

Caused by: java.io.EOFException: The connection has been reset while reading the header
    at com.gemstone.gemfire.internal.cache.tier.sockets.Message.fetchHeader(Message.java:583)
    at com.gemstone.gemfire.internal.cache.tier.sockets.Message.readHeaderAndPayload(Message.java:599)
    at com.gemstone.gemfire.internal.cache.tier.sockets.Message.read(Message.java:542)
    at com.gemstone.gemfire.internal.cache.tier.sockets.Message.recv(Message.java:1029)
    at com.gemstone.gemfire.cache.client.internal.AbstractOp.attemptReadResponse(AbstractOp.java:158)
    at com.gemstone.gemfire.cache.client.internal.AbstractOp.attempt(AbstractOp.java:363)
    at com.gemstone.gemfire.cache.client.internal.ConnectionImpl.execute(ConnectionImpl.java:229)
    at com.gemstone.gemfire.cache.client.internal.pooling.PooledConnection.execute(PooledConnection.java:321)
    at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.executeWithPossibleReAuthentication(OpExecutorImpl.java:646)
    at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:108)
    ... 11 more

How do I get the whole stack instead of the ... 11 more?

解决方案

You have the entire stack.

This is only part of a stack trace. Directly before this was another piece. Look at the bottom lines of this one, and the top lines of the previous one. You'll see them match up. The stack trace began with a section that doesn't begin with "Caused by".

The "Caused by" exception is hiding parts of the stack trace that are verbatim copies of stack trace entries in its parent. In other words, Java doesn't show the entire stack up to main() for every cause - it just shows what you haven't seen already. See the Throwable.printStackTrace() documentation.

The "Caused by" is filled when you provide a cause when creating a Throwable. Look at the constructors for it. This is done when a piece of code catches a low-level exception and then wants to rethrow it as a different exception class.

这篇关于如何在eclipse上显示完整的堆栈跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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