Hi,
We are trying to invoke Guvnor rule(drools-5.0.0.M1-guvnor)
from a Drools project.
For creating the rule in Guvnor, following steps were
followed:
1)
Created a category through Guvnor UI
2)
Created a Package named “myNewPackage”
under that category.
3)
Created and imported a model to this
package by uploading it through Guvnor.
4)
Created a Rule with myNewPakage as the
destination package.
5)
Validated and saved the rule and
built the package.
Attached is the Java code for invoking the above created
Guvnor rule from a Drools project.
We are getting the following error while running the Java
code:
RuleAgent(default) INFO (Fri Jan 16
19:11:21 IST 2009): Configuring with newInstance=false, secondsToRefresh=-1
RuleAgent(default) INFO (Fri Jan 16
19:11:21 IST 2009): Configuring package provider : URLScanner monitoring
URLs:
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/myNewPackage/LATEST
RuleAgent(default) EXCEPTION (Fri Jan 16
19:11:26 IST 2009): null. Stack trace should follow.
java.io.OptionalDataException
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at
org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:185)
at
org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:154)
at
org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:47)
at
org.drools.agent.URLScanner.readPackage(URLScanner.java:142)
at
org.drools.agent.URLScanner.getChangeSet(URLScanner.java:114)
at
org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:90)
at
org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:393)
at
org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:345)
at
org.drools.agent.RuleAgent.configure(RuleAgent.java:330)
at
org.drools.agent.RuleAgent.init(RuleAgent.java:246)
at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:185)
at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:145)
at
kijanowski.eu.GuvnorTest.main(GuvnorTest.java:17)
Exception in thread "main" java.lang.NullPointerException
at
org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:346)
at
org.drools.agent.RuleAgent.configure(RuleAgent.java:330)
at org.drools.agent.RuleAgent.init(RuleAgent.java:246)
at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:185)
at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:145)
at
kijanowski.eu.GuvnorTest.main(GuvnorTest.java:17)
What could be the possible solution for the same?
Regards,
Khushbu Bajaj