Exceptionininitializererror
Solution 1:
Based on this documentation An ExceptionInInitializerError is thrown to indicate that an exception occurred during evaluation of a static initializer or the initializer for a static variable. Check your code has any static initialization logic.
Solution 2:
It appears that the error you are getting is because of a NullPointerException in your class initialization.
static EGLContext glContext;
publicstaticGL11gl= (GL11)glContext.getGL();
You will notice you are attempting to call getGl() from an instance of EGLContext
which isn't initialized. You will need to first assign glContext
to something before you can use it.
The stacktrace mentions <clinit>
, which isn't very helpful if you don't know what it means. It is referencing class initialization, which is what happens when static members are initialized (as in this case), but it could also reference a static initialization block that looks like this:
static {
//some static init code
}
The reason that ExceptionInInitializerError
is throw is likely because something higher up is catching all Exceptions, and wrapping them in the ExceptionInInitializerError
.
Post a Comment for "Exceptionininitializererror"