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