HI,
I had downloaded the drools 5.1 examples which is present in http://www.jboss.org/drools/downloads.html url and trying to run drools-examples-brms\ mortgage-example by following all the steps listed in the how-to document But as RuleAgent is depricated I changed it to KnowledgeAgent and used ChangeSet.xml to provide the URL and authentication details When I started running the application(FinalTest.java) I was getting the followign error: java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:664) at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:889) at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:168) at FinalTest.main(FinalTest.java:25) Caused by: java.io.OptionalDataException at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at org.drools.rule.JavaDialectRuntimeData.readExternal(JavaDialectRuntimeData.java:167) The code used is as follows: FinalTest.java: /** * */ import org.drools.KnowledgeBase; import org.drools.agent.KnowledgeAgent; import org.drools.agent.KnowledgeAgentFactory; import org.drools.builder.ResourceType; import org.drools.definition.type.FactType; import org.drools.io.ResourceFactory; import org.drools.runtime.StatelessKnowledgeSession; /** * @author aditya.madhav.k * */ public class FinalTest { /** * @param args */ public static void main(String[] args) throws InstantiationException, IllegalAccessException{ // TODO Auto-generated method stub KnowledgeAgent ka = KnowledgeAgentFactory.newKnowledgeAgent("MyAgent"); ka.applyChangeSet(ResourceFactory.newClassPathResource("changeset.xml")); KnowledgeBase kb = ka.getKnowledgeBase(); FactType appType = kb.getFactType("mortgages", "LoanApplication"); FactType incomeType = kb.getFactType("mortgages", "IncomeSource"); Object application = appType.newInstance(); Object income = incomeType.newInstance(); appType.set(application, "amount", 25000); appType.set(application, "deposit", 1500); appType.set(application, "lengthYears", 20); incomeType.set(income, "type", "Job"); incomeType.set(income, "amount", 65000); StatelessKnowledgeSession ks = kb.newStatelessKnowledgeSession(); ks.execute( new Object[] {application, income} ); } } and changeset.xml code is: <?xml version="1.0" encoding="UTF-8" ?> - - If anyone knows a solution for this kindly share the same -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/OptionalDataException-while-running-sample-mortagage-example-tp2661626p2661626.html Sent from the Drools - User mailing list archive at Nabble.com. _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users