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(CompositeObjectSinkAdapter.java:501)
18:48:02,688 INFO [STDOUT] at org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.<init>(CompositeObjectSinkAdapter.java:441)
18:48:02,688 INFO [STDOUT] at org.drools.reteoo.CompositeObjectSinkAdapter.hashSinks(CompositeObjectSinkAdapter.java:158)
18:48:02,688 INFO [STDOUT] at org.drools.reteoo.CompositeObjectSinkAdapter.addObjectSink(CompositeObjectSinkAdapter.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.java: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(GroupElementBuilder.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.java: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(ApplicationFilterChain.java:252)
18:48:02,688 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
18:48:02,720 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
18:48:02,720 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
18:48:02,720 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
18:48:02,720 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
18:48:02,720 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
18:48:02,720 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
18:48:02,720 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
18:48:02,720 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java: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:148)
18:48:02,720 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
18:48:02,720 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(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(MasterSlaveWorkerThread.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();
}
}
}