Getting “ArrayIndexOutOfBoundsException: null” with NO stack trace

  1. String concatenated with a null reference might get you such a message:

    Object obj = null;
    throw new ArrayIndexOutOfBoundsException("" + obj);
    
  2. 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)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)