java.lang.NoClassDefFoundError: Could not initialize class XXX

后端 未结 10 1213
無奈伤痛
無奈伤痛 2020-11-27 10:59
public class PropHolder {
  public static Properties prop;

  static {
    //code for loading properties from file
  }
}

// Referencing the class somewhere else:
Pr         


        
10条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 11:34

    As mentioned above, this could be a number of things. In my case I had a statically initialized variable which relied on a missing entry in my properties file. Added the missing entry to the properties file and the problem was solved.

提交回复
热议问题