java.lang.OutOfMemoryError: Java heap space
by vdelbart
Hello,
In my tests of the 4.0.3, I have some : java.lang.OutOfMemoryError.
So, I try a simple test with 10.000 sequential execution of 1 rule with no
context and just a workingmemorylogger and I have the error :
java.lang.OutOfMemoryError: Java heap space
My code is :
public class ExecReglesMemotyTest
{
private static final Reader DRL = new
InputStreamReader(ExecReglesMemotyTest.class
.getResourceAsStream("/rules/exemple.drl"));
private static final String FICHIER_LOG = "session";
/**
* @param args
*/
public static void main(String[] args)
{
try
{
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(DRL);
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(builder.getPackage());
for (int i = 0; i < 10000; i++)
{
StatefulSession session = ruleBase.newStatefulSession();
WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger(session);
logger.setFileName(FICHIER_LOG);
session.fireAllRules();
logger.writeToDisk();
session.dispose();
}
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
with this rule (doesn't matter):
#created on: Fri Nov 09 15:48:45 CET 2007
package initPackage
#list any import classes here.
rule "ERG9"
when
then
end
I try this in 4.0.1, and it's working (no OutOfMemoryError)
What's the problem ?
thanks for any information,
V.
--
View this message in context: http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tf477...
Sent from the drools - user mailing list archive at Nabble.com.
12 years, 1 month
getting mismatched '==' error
by zeeshan
Hi !
Please find my attached Decision Table. I am getting following error...
log4j:WARN No appenders could be found for logger (com.sample.RuleRunner).
log4j:WARN Please initialize the log4j system properly.
Warning: Cell at E20 not present - adding a blank
Warning: Cannot read name ranges for Excel_BuiltIn__FilterDatabase_1 -
setting to empty
Warning: Cannot read name ranges for Excel_BuiltIn__FilterDatabase_1 -
setting to empty
Warning: Cannot read name ranges for Excel_BuiltIn__FilterDatabase_1 -
setting to empty
Exception in thread "main" org.drools.rule.InvalidRulePackage: [10,9]: [ERR
102] Line 10:9 mismatched input '==' in rule "Distribution Cost Rules_11"
[23,9]: [ERR 102] Line 23:9 mismatched input '==' in rule "Distribution Cost
Rules_12"
[36,9]: [ERR 102] Line 36:9 mismatched input '==' in rule "Distribution Cost
Rules_13"
[49,9]: [ERR 102] Line 49:9 mismatched input '==' in rule "Distribution Cost
Rules_14"
[62,9]: [ERR 102] Line 62:9 mismatched input '==' in rule "Distribution Cost
Rules_15"
[75,9]: [ERR 102] Line 75:9 mismatched input '==' in rule "Distribution Cost
Rules_16"
[88,9]: [ERR 102] Line 88:9 mismatched input '==' in rule "Distribution Cost
Rules_17"
[101,9]: [ERR 102] Line 101:9 mismatched input '==' in rule "Distribution
Cost Rules_18"
[114,9]: [ERR 102] Line 114:9 mismatched input '==' in rule "Distribution
Cost Rules_19"
[127,9]: [ERR 102] Line 127:9 mismatched input '==' in rule "Distribution
Cost Rules_20"
[140,9]: [ERR 102] Line 140:9 mismatched input '==' in rule "Distribution
Cost Rules_21"
[153,9]: [ERR 102] Line 153:9 mismatched input '==' in rule "Distribution
Cost Rules_22"
[166,9]: [ERR 102] Line 166:9 mismatched input '==' in rule "Distribution
Cost Rules_23"
[179,9]: [ERR 102] Line 179:9 mismatched input '==' in rule "Distribution
Cost Rules_24"
[192,9]: [ERR 102] Line 192:9 mismatched input '==' in rule "Distribution
Cost Rules_25"
[205,9]: [ERR 102] Line 205:9 mismatched input '==' in rule "Distribution
Cost Rules_26"
[218,9]: [ERR 102] Line 218:9 mismatched input '==' in rule "Distribution
Cost Rules_27"
[231,9]: [ERR 102] Line 231:9 mismatched input '==' in rule "Distribution
Cost Rules_28"
[244,9]: [ERR 102] Line 244:9 mismatched input '==' in rule "Distribution
Cost Rules_29"
[257,9]: [ERR 102] Line 257:9 mismatched input '==' in rule "Distribution
Cost Rules_30"
[270,9]: [ERR 102] Line 270:9 mismatched input '==' in rule "Distribution
Cost Rules_31"
[283,9]: [ERR 102] Line 283:9 mismatched input '==' in rule "Distribution
Cost Rules_32"
[296,9]: [ERR 102] Line 296:9 mismatched input '==' in rule "Distribution
Cost Rules_33"
[309,9]: [ERR 102] Line 309:9 mismatched input '==' in rule "Distribution
Cost Rules_34"
[0,0]: Parser returned a null Package
at org.drools.rule.Package.checkValidity(Package.java:471)
at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:481)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:436)
at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:443)
at com.sample.RuleRunner.loadRules(RuleRunner.java:70)
at com.sample.RuleRunner.runStatelessRules(RuleRunner.java:185)
at com.sample.RuleMain.main(RuleMain.java:132)
http://drools.46999.n3.nabble.com/file/n4017627/Distribution_Factor.xls
Distribution_Factor.xls
--
View this message in context: http://drools.46999.n3.nabble.com/getting-mismatched-error-tp4017627.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
Unable to find implementation for BusinessRuleProvider
by John Peterson
Hi,
I've been experimenting with the Guided Rule Editor plug-in in Eclipse.
I've built a Drools Project using the default Hello World sample
application. I've created a new "Guided Rule" in my project called
"GuidedRule.brl" and get the associated "drools.package" with it. The
rule is simple:
WHEN
THEN
System.out.println("Rule has fired");
I build the knowledge base as follows:
private static KnowledgeBase readKnowledgeBase() throws
Exception {
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("SampleGuided.drl"),
ResourceType.BRL);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
for (KnowledgeBuilderError error: errors) {
System.err.println(error);
}
throw new IllegalArgumentException("Could not
parse knowledge.");
}
KnowledgeBase kbase =
KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}
The only line changed is adding the resource of type BRL.
When I try to run, I get the following error:
java.lang.RuntimeException: org.drools.compiler.DroolsParserException:
org.drools.CheckedDroolsException: Unable to find implementation for
BusinessRuleProvider
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.j
ava:544)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.ja
va:28)
at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:41)
at com.sample.DroolsTest.main(DroolsTest.java:23)
Caused by: org.drools.compiler.DroolsParserException:
org.drools.CheckedDroolsException: Unable to find implementation for
BusinessRuleProvider
at
org.drools.compiler.PackageBuilder.addPackageFromBrl(PackageBuilder.java
:386)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.j
ava:470)
... 3 more
Caused by: org.drools.CheckedDroolsException: Unable to find
implementation for BusinessRuleProvider
at
org.drools.compiler.BusinessRuleProviderFactory.throwNoImplementationFou
nd(BusinessRuleProviderFactory.java:66)
at
org.drools.compiler.BusinessRuleProviderFactory.loadProvider(BusinessRul
eProviderFactory.java:42)
at
org.drools.compiler.BusinessRuleProviderFactory.getProvider(BusinessRule
ProviderFactory.java:25)
at
org.drools.compiler.PackageBuilder.addPackageFromBrl(PackageBuilder.java
:366)
... 4 more
I've tried variations to add the drools.package as a PKG type, I've had
the rules (and package) in both "com.sample" and /src/main/rules, but I
can't seem to resolve the problem. "drools.package" has been updated to
include the package name (package com.sample;) and I import the message
class as well (even though it isn't being used currently).
I suspect the issue is simple, but I haven't been able to figure it out.
Any help would be appreciated.
12 years, 1 month
Persistence in fireUntilHalt() loop
by Alberto R. Galdo
Hi,
We're running an application that uses Drools + JBPM 5 + Drools
integration our set-up can be seen as:
Some rule fires and creates a JBPM process ( a fact gets inserted into
drools using "kcontext.getKnowledgeRuntime().startProcess("testProcess")"
). We have a problem with the persistence of this processes. Persistence is
implemented with JPA and JTA. Our application runs with fireUntilHalt() and
when a process is launched from the consequence of any of the rules the
persistence of the process fails. If the application runs with
fireAllRules(), the persistence works like a charm.
The error shown is as follow:
Exception in thread "Thread-5" Exception executing consequence for rule
"Run Process" in com.sample: java.lang.NullPointerException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1101)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
at org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1229)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:754)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:730)
at
org.drools.command.runtime.rule.FireUntilHaltCommand$1.run(FireUntilHaltCommand.java:50)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at
org.jbpm.persistence.processinstance.JPAProcessInstanceManager.addProcessInstance(JPAProcessInstanceManager.java:44)
at
org.jbpm.process.instance.AbstractProcessInstanceFactory.createProcessInstance(AbstractProcessInstanceFactory.java:36)
at
org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:182)
at
org.jbpm.process.instance.ProcessRuntimeImpl.createProcessInstance(ProcessRuntimeImpl.java:154)
at
org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:135)
at
org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:130)
at
org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1074)
at
org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)
at com.sample.Rule_Run_Process.defaultConsequence(Rule_Run_Process.java:9)
at com.sample.Rule_Run_ProcessDefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
... 6 more
The problem is in this function:
public void addProcessInstance(ProcessInstance processInstance) {
ProcessInstanceInfo processInstanceInfo = new ProcessInstanceInfo(
processInstance, this.kruntime.getEnvironment() );
ProcessPersistenceContext context
= ((ProcessPersistenceContextManager)
this.kruntime.getEnvironment()
.get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER ))
.getProcessPersistenceContext();
// @PrePersist added to ProcessInstanceInfo because of this
context.persist( processInstanceInfo );
((org.jbpm.process.instance.ProcessInstance)
processInstance).setId( processInstanceInfo.getId() );
processInstanceInfo.updateLastReadDate();
internalAddProcessInstance(processInstance);
}
We think after that persist sentence, the entity manager would have to run
a flush sentence for the process instance is inserted into database and get
the ID.
Greets.
12 years, 2 months
System problems
by paco
I am using Drools 5.4.0, guvnor 5.3.0 and default database.
I imported the rules with XML file (550 KB) in Guvnor. After I can check,
validate and test (with run analysis button) the rules without problems.
Everything works fine.
After when I import ed other rules XML file (30,000 KB), I realized that the
system becomes too slow and obviously I can no longer veifier, validate or
test my rules.
Please suggest
--
View this message in context: http://drools.46999.n3.nabble.com/System-problems-tp4018363.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months
Continuous Planning values for task planning
by Josef Bajada
Hi,
I am new to Drools and Drools Planner, so apologies if I am asking anything
obvious.
My objective is to implement a simple (for now) planner which schedules
tasks according to 2 main criteria:
- Their duration (in seconds)
- Their dependencies on other tasks (e.g. Hard Constraint that Task B has
to start between 180 and 200 seconds after Task A finishes).
Since there are gaps between dependent tasks as part of the hard
constraints other tasks can be fitted in between dependent tasks.
So the Solver needs to find the optimal start time for each task that
satisfies the hard constraints, and in the shortest total timeline possible
to complete all tasks (soft constraint).
The main problem I am finding is that this start time, which is essentially
the planning variable is a continuous variable.
Chapter 4 of the Drools documentation mentions very briefly (Section
4.3.4.1) that planning variables can be continuous, but there does not
seem to be any more details about how to achieve this.
Even if the planning variable was discrete (say bins of 5 second
intervals), there is no upper bound as such.
How is it best to handle such planning variables in Drools Planner?
thanks,
josef
12 years, 2 months
Drools Guvnor 5.2 Issue on Websphere AS 7
by Ravikiran
Hi Drools gurus,
I am back again. As most of you know that i had many 'weld' related issues
for deploying Drools Guvnor 5.4 in Webspere 7. After all my trails, i have
decided to go for Guvnor 5.2 (which doesn't have weld+seam dependancies)
deployment on Websphere As7.
This time, I was able to deploy Guvnor 5.2.0 Final on Websphere AS7
successfully without any errors. I have changed the repository to my own
file path. When i launch the guvnor for the first it had asked me to load
the sample packages, i have chosen YES. It was succeffully loaded all sample
packages into my given file path. That's it, after the loading, my browser
window was completely blank except "Drools" logo on top left and
guest[signout] on top right.
Any Idea what was wrong with my setup. What should i do to get the guvnor
web...Please help.
http://localhost:9080/drools-guvnor/org.drools.guvnor.Guvnor/Guvnor.html
I saw view source,
----
----
<link rel="stylesheet" href="css/Guvnor.css">
<link rel="stylesheet" href="css/Guvnor_DecoratedPopupPanel.css">
<link rel="stylesheet" href="css/ruleflow.css">
</head>
<body>
<iframe id="__gwt_historyFrame" style="width: 0; height: 0; border:
0"></iframe>
<div id="loading">
<div class="loading-indicator">
images/loading-icon.gif
Please wait<br />
Loading application...
</div>
</div>
</body>
</html>
-----------------------------------------------------------------------------------------------
Is it something to do with 'org.drools.guvnor.Guvnor.nocache.js'?
thanks a lot in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-5-2-Issue-on-Websphere-AS...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months
NPE loading Drools 5.4.0.Beta1 using drools-spring
by lhorton
I am trying to load up 5.4.0.Beta1. I'm using Spring configuration xml that
works fine in 5.2.0.Final. In the xml, my grid-node is defined as:
<drools:grid-node id="droolsClusterNode1"/>
The exception is a NPE on a method in WhitePagesClient. Any idea what the
cause might be? Has anyone successfully loaded 5.4.0 using Spring?
The full exception is:
ERROR 2012-01-06 15:51:05,998
[org.springframework.web.context.ContextLoader] - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'droolsClusterNode1': Invocation of init method failed; nested
exception is java.lang.NullPointerException
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:563)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1399)
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
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500)
at
org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:252)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186)
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:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at
org.drools.grid.service.directory.impl.WhitePagesClient.getGsd(WhitePagesClient.java:32)
at
org.drools.grid.service.directory.impl.WhitePagesClient.create(WhitePagesClient.java:80)
at org.drools.grid.impl.GridImpl.createGridNode(GridImpl.java:107)
at
org.drools.container.spring.beans.GridNodeBeanFactory.afterPropertiesSet(GridNodeBeanFactory.java:63)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 47 more
--
View this message in context: http://drools.46999.n3.nabble.com/NPE-loading-Drools-5-4-0-Beta1-using-dr...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months