Hi ,
I Build few classes using Eclipse and then import it into "JBoss BRMS"
then I created few rule and and using "knowledge base" I created binary
package.
I try to open the pkg using Eclipse with this code :
Collection<KnowledgePackage> kpkgs = new ArrayList<KnowledgePackage>();
ObjectInputStream in = new ObjectInputStream(new FileInputStream(
"c:/com.jspeed.brms.fire.pkg"));
Object o = in.readObject();
System.out.println("Read: pkg ok ");
in.close();
KnowledgePackage kp = (KnowledgePackage) o;
kpkgs.add(kp);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kpkgs);
and I am getting error -
java.io.ObjectInputStream cannot be cast to
org.drools.common.DroolsObjectInput
What am I doing wrong ?
My imports :
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.definition.KnowledgePackage;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.rule.FactHandle;
--
View this message in context:
http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2848...
Sent from the Drools: User forum mailing list archive at
Nabble.com.