Debugging ExceptionInInitializerError

959 views Asked by At

After a Java 10 migration, I am encountering an error java.lang.ExceptionInInitializerError

With no other info. Error occurs when I try to run/debug the project. Where should I begin looking to diagnose this?

Here is the full output in the console:

Information:java: Errors occurred while compiling module 'pw-support-server_main'
Information:javac 10.0.2 was used to compile java sources
Information:11/27/2018 6:06 PM - Compilation completed with 1 error and 0 warnings in 2 s 173 ms
Error:java: java.lang.ExceptionInInitializerError
1

There are 1 answers

0
8t12c7081 On

Resolved using the following steps, which are probably very specific to my situation:

Changes to build.gradle:

buildscript {
    dependencies {
        classpath "io.franzbecker:gradle-lombok:1.10"
    }
}

Changed to classpath "io.franzbecker:gradle-lombok:1.14" (update to latest version)

Added inside of the block allprojects {

lombok {
    version = "1.18.4"
    sha256 = ""
}

The Franzbecker-lombok thing defaults to installing lombok 1.16.20, which has this issue. Telling gradle to use lombok's latest version solved this. Getting the right syntax among all the gradle version changes, Java version changes, etc, was just a little confusing.

Side note: The issue also occurred on Java 11.