Hi drools team,
I am using JBRMS for creating the rules.
I am able to download the binary package from JBRMS,and also able to use
it in the Runtime System,but when I try to
use three packages at a time it generates an error as mentioned below.My
Runtime system works fine when I use only two packages.Could you please
suggest, what's going wrong.I have checked this error on rules-user list
and someone got a reply
like it seems to be a bug from Edson Tirelli .
Link:::
http://lists.jboss.org/pipermail/rules-users/2007-May/001353.html
18:48:02,688 INFO [STDOUT] java.lang.NullPointerException
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.setValue(CompositeO
bjectSinkAdapter.java:501)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.<init>(CompositeObj
ectSinkAdapter.java:441)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.CompositeObjectSinkAdapter.hashSinks(CompositeObjectSi
nkAdapter.java:158)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.CompositeObjectSinkAdapter.addObjectSink(CompositeObje
ctSinkAdapter.java:72)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.ObjectSource.addObjectSink(ObjectSource.java:104)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.ObjectTypeNode.addObjectSink(ObjectTypeNode.java:313)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.AlphaNode.attach(AlphaNode.java:116)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.builder.BuildUtils.attachNode(BuildUtils.java:129)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.builder.PatternBuilder.attachAlphaNodes(PatternBuilder
.java:118)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.builder.PatternBuilder.attachPattern(PatternBuilder.ja
va:70)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.builder.PatternBuilder.build(PatternBuilder.java:54)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElem
entBuilder.java:111)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.
java:69)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder
.java:143)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.ja
va:108)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:112)
18:48:02,688 INFO [STDOUT] at
org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:266)
18:48:02,688 INFO [STDOUT] at
org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:294)
18:48:02,688 INFO [STDOUT] at
com.aha.processor.RulesProcessor.readRules(RulesProcessor.java:61)
18:48:02,688 INFO [STDOUT] at
com.aha.processor.RulesProcessor.<init>(RulesProcessor.java:40)
18:48:02,688 INFO [STDOUT] at
com.aha.processor.RulesProcessor.getInstance(RulesProcessor.java:50)
18:48:02,688 INFO [STDOUT] at
com.aha.servlet.MCPServlet.process(MCPServlet.java:95)
18:48:02,688 INFO [STDOUT] at
com.aha.servlet.MCPServlet.execute(MCPServlet.java:78)
18:48:02,688 INFO [STDOUT] at
com.aha.servlet.MCPServlet.doGet(MCPServlet.java:41)
18:48:02,688 INFO [STDOUT] at
com.aha.servlet.MCPServlet.doPost(MCPServlet.java:56)
18:48:02,688 INFO [STDOUT] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
18:48:02,688 INFO [STDOUT] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
18:48:02,688 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:252)
18:48:02,688 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
18:48:02,720 INFO [STDOUT] at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
r.java:81)
18:48:02,720 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:202)
18:48:02,720 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
18:48:02,720 INFO [STDOUT] at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:213)
18:48:02,720 INFO [STDOUT] at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:178)
18:48:02,720 INFO [STDOUT] at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipa
lValve.java:39)
18:48:02,720 INFO [STDOUT] at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAs
sociationValve.java:153)
18:48:02,720 INFO [STDOUT] at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.j
ava:59)
18:48:02,720 INFO [STDOUT] at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
18:48:02,720 INFO [STDOUT] at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
18:48:02,720 INFO [STDOUT] at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:107)
18:48:02,720 INFO [STDOUT] at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
18:48:02,720 INFO [STDOUT] at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:85
6)
18:48:02,720 INFO [STDOUT] at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:744)
18:48:02,720 INFO [STDOUT] at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:527)
18:48:02,720 INFO [STDOUT] at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorker
Thread.java:112)
18:48:02,720 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
My Rule Engine code snippet is as follows:::
private RulesProcessor(){
ruleBase = RuleBaseFactory.newRuleBase();
System.out.println("rule base constructor fired!!");
try{
FileInputStream fileStream = new FileInputStream(
"C:/drools/SessionRule.pkg" );
readRules(ruleBase,fileStream);
fileStream = null;
fileStream = new FileInputStream(
"C:/drools/WorkFlowRulesPackage.pkg" );
readRules(ruleBase,fileStream);
fileStream = null;
fileStream = new FileInputStream(
"C:/drools/AuthorizationPackage.pkg" );
readRules(ruleBase,fileStream);
fileStream = null;
}
catch(Exception e){
e.printStackTrace();
}
}
private void readRules(RuleBase ruleBase,InputStream inputStream){
ObjectInputStream objectInputStream = null;
Object objPackage = null;
try {
objectInputStream = new
ObjectInputStream(inputStream);
objPackage = objectInputStream.readObject();
ruleBase.addPackage((Package)objPackage);
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally{
try{
objectInputStream.close();
inputStream.close();
}catch (IOException e){
e.printStackTrace();
}
}
}