I revised my method to write a single package and to use the Drools stream
classes:
KnowledgePackage pkg = packages.iterator().next();
DroolsObjectOutputStream out;
try {
out = new DroolsObjectOutputStream(new FileOutputStream(outFilePath));
DroolsStreamUtils.streamOut(out, pkg, Boolean.TRUE);
out.close();
} catch (IOException ex) {
logger.debug(ex.getMessage());
}
I tested this with the compression option and without, but knowledge agent
still cannot deserialize. I now get exception:
Caused by: java.io.OptionalDataException
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1339)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:205)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:174)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:653)
--
View this message in context:
http://drools.46999.n3.nabble.com/rules-users-KnowledgeAgent-exception-wh...
Sent from the Drools: User forum mailing list archive at
Nabble.com.