我怎样才能在蚂蚁构建创建一个罐子的错误堆栈跟踪的源代码行数? [英] How can I get the source line number in error stack trace of a jar created by ant build?
本文介绍了我怎样才能在蚂蚁构建创建一个罐子的错误堆栈跟踪的源代码行数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Ant来构建我的Eclipse项目的罐子。我部署在Tomcat的罐子。但每当一个例外,在我的code(这是内部JAR)发生错误堆栈跟踪来,但行号不来 - 而不是它说未知源
I am using ant to build a jar of my project in eclipse. I deploy that jar on tomcat. But whenever an exception happen in my code (which is inside jar), the error stack trace comes but the line number does not come -- instead it says unknown source.
我怎样才能获得的行号错误的堆栈跟踪?
How can I get the line numbers in error stack trace?
推荐答案
您需要编译调试信息的罐子。具体来说,您需要找到的javac
任务编译的类,你以后罐子,并添加调试=关于
属性。例如:
You need to compile your jar with debug information. Specifically, you need to find the javac
task that compiles the classes that you later jar and add a debug="on"
attribute. Example:
<javac srcdir="${src}"
destdir="${build}"
classpath="xyz.jar"
debug="on"
source="1.4" />
全部细节,可以发现这里。
这篇关于我怎样才能在蚂蚁构建创建一个罐子的错误堆栈跟踪的源代码行数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文