Hi,
I'm using drools 4.0.1. I'm first adding one package to my RuleBase object,
and everything works just fine:
...
builder.addPackageFromDrl(new InputStreamReader(resource.getInputStream()));
if(ruleBase == null) {
ruleBase = RuleBaseFactory.newRuleBase();
}
ruleBase.addPackage(builder.getPackage());
But after some time i need to refresh my rules, so i'm using following code
to remove previous package:
ruleBase.removePackage("org.sample.mypackage");
and i'm getting the following error:
java.lang.NullPointerException
at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:222)
at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:272)
at
org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:460)
at
com.diosphere.diomedia.common.drools.impl.RulesServiceImpl.refresh(RulesServiceImpl.java:121)
at
com.diosphere.diomedia.service.impl.PromotionManagerImpl.refreshDRLs(PromotionManagerImpl.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at uk.ltd.getahead.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:170)
at
uk.ltd.getahead.dwr.impl.DefaultProcessor.doExec(DefaultProcessor.java:552)
at
uk.ltd.getahead.dwr.impl.DefaultProcessor.handle(DefaultProcessor.java:88)
at uk.ltd.getahead.dwr.DWRServlet.doPost(DWRServlet.java:178)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
net.sf.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:167)
at
net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Does anyone have a clue what might be the problem, and how to fix it?
Kind regards!
--
View this message in context:
http://www.nabble.com/Problem-with-removePackage%28%29-tf4727072.html#a13...
Sent from the drools - user mailing list archive at
Nabble.com.