jpmml / jpmml-android

PMML evaluator library for the Android operating system (http://www.android.com/)
GNU Affero General Public License v3.0
28 stars 12 forks source link

Issue of the consistency between SER producer and consumer #5

Closed dychen24 closed 5 years ago

dychen24 commented 5 years ago

Hi,

Thank you for this very helpful repository. I'd like to report an issue of the consistency between the SER producer and SER consumer.

As quoted from the README file:

Extra caution is required to ensure that the SER producer (ie. the JPMML-Model Maven plugin) and the SER consumer (ie. the JPMML-Android library) are using exactly the same version of the JPMML-Model library at all times.

The issue I've found is, the serialversionUID is still different even I'm using the same version of both SER producer and consumer.

For example, when I'm using org.jpmml:pmml-maven-plugin:1.4.8 for both .pmml.ser gerneration and the Android app, I got the following error: local class incompatible: stream classdesc serialVersionUID = 6735485, local class serialVersionUID = 6735487 I'm not sure about the exact cause of this error.

To have the same serialVersionUID, I came up with a workaround by using org.jpmml:pmml-maven-plugin:1.4.8 for generating the SER file, while using org.jpmml:pmml-maven-plugin:1.4.6 in the Android dependency.

Please let me know if you have any insight on this issue.

Thanks!

vruusmann commented 5 years ago

The issue I've found is, the serialversionUID is still different even I'm using the same version of both SER producer and consumer.

For example, when I'm using org.jpmml:pmml-maven-plugin:1.4.8 for both .pmml.ser gerneration and the Android app,

JPMML-Model and JPMML-Evaluator libraries use different version numbers. For example, JPMML-Model 1.4.8 and JPMML-Evaluator 1.4.8 do not belong together.

local class incompatible: stream classdesc serialVersionUID = 6735485, local class serialVersionUID = 6735487

serialVersionUID to JPMML-Model version mappings:

This exception that you're reporting makes very clear that you've saved the SER file using 1.4.8, but are attempting to load it back into 1.4.10.

Please let me know if you have any insight on this issue.

Fix your classpath(s). Better yet, switch from SER to JSON for model transport.

dychen24 commented 5 years ago

Switching to JSON sounds promising, I'll definitely try it. Thank you for your fast response!