Java异常堆栈被抑制-如何打印出整个堆栈



n:我得到以下Java异常堆栈。正如你在底部看到的那样,堆栈被抑制了(注意"…

java程序作为Ant任务启动。有人知道如何让Java或Ant打印出整个错误堆栈吗?

 [java] javax.jms.JMSException: Failed to create session factory
 [java]       at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:615)
 [java]       at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:121)
 [java]       at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:116)
 [java]       at org.hornetq.jms.example.QueueExample.runExample(QueueExample.java:56)
 [java]       at org.hornetq.common.example.HornetQExample.run(HornetQExample.java:76)
 [java]       at org.hornetq.jms.example.QueueExample.main(QueueExample.java:35)
 [java] Caused by: HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]
 [java]       at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:619)
 [java]       at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:611)
 [java]       ... 5 more
 [java]
 [java] #####################
 [java] ###    FAILURE!   ###
 [java] #####################
 [java] Java Result: 1

您不需要看到整个堆栈。…5表示以下5个StackTraceElements是来自包装器Exception(在您的例子中:javax.jms.JMSException)的最后5个元素。要了解更多信息,请访问Javadoc上的printStacktrace()方法,它包含一个非常详细的示例,可以看到您在stacktrace

中看到的内容。

相关内容

  • 没有找到相关文章

最新更新