Java Reference
In-Depth Information
cipe about Jenkins applies equally to Hudson. If you use a different CI system, you'll need to
check that system's documentation, but the concepts and the benefits will be similar.
Getting Readable Tracebacks
Problem
You're getting an exception stack trace at runtime, but most of the important parts don't have
line numbers.
Solution
Be sure you have compiled with debugging enabled. On older systems, disable JIT and run it
again, or use the current HotSpot runtime.
Discussion
When a Java program throws an exception, the exception propagates up the call stack until
there is a catch clause that matches it. If none is found, the Java interpreter program that in-
voked your main() method catches the exception and prints a stack traceback showing all
the method calls that got from the top of the program to the place where the exception was
thrown. You can print this traceback yourself in any catch clause: the Throwable class has
several methods called printStackTrace() .
The traceback includes line numbers only if they were compiled in. When using javac , this
is the default. When using Ant's javac task, this is not the default; you must be sure you
have used <javac debug="true " …> in your build.xml file if you want line numbers.
Finding More Java Source Code: Programs, Frameworks,
Libraries
Problem
You want to build a large application and need to minimize coding, avoiding the “Not Inven-
ted Here” syndrome.
Search WWH ::




Custom Search