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?
You need to compile your jar with debug information. Specifically, you need to find the
javactask that compiles the classes that you later jar and add adebug="on"attribute. Example:Full details can be found here.