[rules-users] Serialization of packages: InvalidClassException / serialVersionUID

Bernd Rücker bernd.ruecker at camunda.com
Tue Sep 1 11:21:26 EDT 2009


Hi!



I really struggled some time with serialization issues: I want to create a
pkg and package that with the jar. From there I want to read it during
runtime.



Easy I thought. Drools 5 way should be to serialize the KnowledgeBase,
right? At least, this is what the AntTask does.



If I try to serialize the KnowledgePackage I get an excpetion anyway:





Okay. Back to the KnowledgeBase. Serialized with Drools 5.0.0.M4 and try
to read it with 5.0.0.M5:



Caused by: java.io.InvalidClassException:

  org.drools.impl.KnowledgeBaseImpl;

  local class incompatible: stream classdesc serialVersionUID =
-4540376767025107954,

  local class serialVersionUID = -3186110098262381425



So it seems Drools Packages are NOT compatible between minor versions?
This would be a disaster for deployment. Or do I serialize the wrong
thing? Unfortunately I didn’t find anything in the docs about it.



Then I tried to do it the “old” Drools 4 way and serialize Package
objects, but same problem with a different serialVersionUID!



Why do these important classes don’t have a serialVersionUID? Or how
should that be loaded? Must be a big issue with Govner, so I think there
must be a solution already?



Thanks for any help!



Cheers

Bernd



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090901/7da5004e/attachment.html 


More information about the rules-users mailing list