I am using Weka (v3.8.1) Machine Learning within my App Engine Application. In order to run it, I load my ML model file from the "WEB-INF" directory using Weka SDK by calling the following code:
Classifier cls = (Classifier) weka.core.SerializationHelper.read("WEB-INF/j48_2.model");
For some reason I get an exception reading my model file - StreamCorruptedException with the message: "invalid stream header: EFBFBDEF".
Initially I suspected that the model file is corrupted, but when I run the same code from outside GAE, from a plain java project with the following maven dependency, it works perfectly and the same model file is loaded:
<dependency>
<groupId>nz.ac.waikato.cms.weka</groupId>
<artifactId>weka-stable</artifactId>
<version>3.8.1</version>
</dependency>
Is the content or the header of a file changes by packaging it in the GAE project? How can I overcome it?
I would really appreciate any advise.
Thanks
Shachar