More careful reading of  org.drools.rule.Package shows that readExternal and writeExternal aren't working on plain ObjectOutputStream in combination with change set monitoring. You must

      OutputStream os = new FileOutputStream( pkgPath );
      ObjectOutputStream oos = new DroolsObjectOutputStream( os );
      KnowledgePackage kPackage = kBuilder.getKnowledgePackages().iterator().next();
      oos.writeObject( kPackage );
      oos.close();

org.drools.common.DroolsObjectOutputStream - although just a renaming subclass of ObjectOutputStream - is not part of the "stable" API.

-W


On 16 June 2011 19:46, lhorton <LHorton@abclegal.com> wrote:
That is what I was doing in my original source.  Your code gives me the same
original exception:

Caused by: java.lang.ClassCastException: [B cannot be cast to
org.drools.rule.DialectRuntimeRegistry

--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-KnowledgeAgent-exception-while-trying-to-deserialize-KnowledgeDefinitionsPackage-tp3064043p3073009.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users