Fix JNIService NullpointerException issue.