Jelle Klap wrote:This maybe related to a JIT compiler optimization that recompiles a method it throws a certain exception a couple of times. After recompilation the compiler can throw a pre-allocated exception, which naturally doesn't have the correct, or rahter any, strack trace.
Though this was a "bug" in the Hotspot server JVM, you seem to be using an Java 6 compatible IcedTea JVM. So I'm not sure if the same workaround applies to it, but for the hotspot VM there's a flag -XX:-OmitStackTraceInFastThrow that turns of the JIT optimization.
Jeff Verdegan wrote:
Then that's not a stack trace. That's just the exception's toString(). Did you study my code and its output?