I am trying to write a java wrapper to use my h2o mojo model. When I load my model zip files in, I receive a null pointer exception. Below is a sample of my code:
public static void main(String[] args) throws Exception {
EasyPredictModelWrapper predict_model = new EasyPredictModelWrapper(
MojoModel.load("prediction_football_model.zip"));
EasyPredictModelWrapper class_model = new EasyPredictModelWrapper(
MojoModel.load("classification_football_model.zip"));
}
and error Message:
Exception in thread "main" java.lang.NullPointerException: entry
at java.util.zip.ZipFile.getInputStream(ZipFile.java:346)
at hex.genmodel.ZipfileMojoReaderBackend.getTextFile(ZipfileMojoReaderBackend.java:18)
at hex.genmodel.ModelMojoReader.parseModelInfo(ModelMojoReader.java:154)
at hex.genmodel.ModelMojoReader.readFrom(ModelMojoReader.java:27)
at hex.genmodel.MojoModel.load(MojoModel.java:35)
at GamePrediction.main(GamePrediction.java:52)
I have been working on this code in eclipse and I have placed both of the zip files in the main project folder. I created the models in R using the h2o.download_mojo() function. I looked into the error message and found that my ZipEntry for the given path's were Null, but I could not find a solution to that.
Any help or insight would be helpful. I couldn't find any other issues like this so if this is a duplicate, please point me to the right direction!