-
String
concatenated with anull
reference might get you such a message:Object obj = null; throw new ArrayIndexOutOfBoundsException("" + obj);
-
If you’re using an Oracle JVM you may want to add
-XX:-OmitStackTraceInFastThrow
as an additional parameter to see if it helps. For some basic exceptions, the JVM reuses the same exception instance after a while, in which case there’s no stack trace anymore. This option prevents the reuse, so you always get a stack trace.
Edit note: this last could also apply to a recent version of OpenJDK (e.g., 1.8)