Scaling Drools based application
by Arul Prashanth
We have an requirement to scale the implemented Drools Rule Engine to all
states in United States. With respect to the current implementation we have
around 50 decision tables which when packaged creates a 200 MB pkg file and
another pkg around 150 MB. The request which the drools engine consumes is a
150 KB xml file which is marshalled and processed. We have a JBoss server
configured with 4 GB of memory (heap size + permGen) and works well with
processing 5 concurrent request. Any request beyond 5 leads to
OutOfMemoryException
Now we have to scale this application to process request from 45 states, so
there will be state specific pkg files (350 MB of pkg file). Each pkg is
different for each state.
With all this, do we need to increase the memory as no of states * 4 GB. Is
this assumption correct? Is there a better architecture to handle scaling of
drools application.
Any memory/performance tuning tricks would also be helpful.
-----
- Prashanth
--
View this message in context: http://drools.46999.n3.nabble.com/Scaling-Drools-based-application-tp4026...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Weird classloader problem
by Alexander Herwix
Hey guys,
using Drools 6 RC4. I have a simple rule which should cast an object into a specialized object (if it is indeed a specialization) and insert that into the session.
rule "Obj is SpecialObject"
salience 201
when
$mainObj : MainObj(obj.class == SpecialObject.class, $obj : obj)
then
System.out.println("Obj is SpecialObj");
SpecialObj specialObj = (SpecialObj) $obj;
insert(specialObj);
end
This rule doesn't even compile and I get a nasty error: NoClassDefFoundError: com/iterranux/droolsjbpmHumanTask/domain/team__I (wrong name: com/iterranux/droolsjbpmHumanTask/domain/Team__I).
I mean it looks like the Class is present, but somehow it's lowercased somewhere. It's weird I can use some other obj but this doesn't work. Anyone seen something like this before? Maybe some other way to do what I want to do? I tried to declare a trait and don that obj with that but same result.
Another question would be if it is really necessary to insert the object as a new fact, or could I access the nested property directly in a rule and typecast it there somehow?
Cheers, Alex
Error java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
| Error at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:104)
| Error at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
| Error at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
| Error at java.lang.ClassLoader.defineClass1(Native Method)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
| Error at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
| Error at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
| Error at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
| Error at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:648)
| Error at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:758)
| Error at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:746)
| Error at java.lang.Class.forName0(Native Method)
| Error at java.lang.Class.forName(Class.java:266)
| Error at org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:80)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
| Error at java.lang.Class.forName0(Native Method)
| Error at java.lang.Class.forName(Class.java:266)
| Error at org.mvel2.ParserConfiguration.checkForDynamicImport(ParserConfiguration.java:163)
| Error at org.mvel2.ParserConfiguration.hasImport(ParserConfiguration.java:191)
| Error at org.mvel2.ParserContext.hasImport(ParserContext.java:360)
| Error at org.mvel2.compiler.AbstractParser.createPropertyToken(AbstractParser.java:1341)
| Error at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:846)
| Error at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:128)
| Error at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
| Error at org.mvel2.MVEL.analyze(MVEL.java:680)
| Error at org.mvel2.compiler.PropertyVerifier.getMethod(PropertyVerifier.java:536)
| Error at org.mvel2.compiler.PropertyVerifier.analyze(PropertyVerifier.java:120)
| Error at org.mvel2.compiler.ExpressionCompiler.verify(ExpressionCompiler.java:381)
| Error at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:273)
| Error at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
| Error at org.mvel2.MVEL.analyze(MVEL.java:680)
| Error at org.mvel2.MVEL.analyze(MVEL.java:685)
| Error at org.drools.compiler.rule.builder.dialect.mvel.MVELExprAnalyzer.analyzeExpression(MVELExprAnalyzer.java:114)
| Error at org.drools.compiler.rule.builder.dialect.mvel.MVELDialect.analyzeBlock(MVELDialect.java:539)
| Error at org.drools.compiler.rule.builder.dialect.mvel.MVELConsequenceBuilder.build(MVELConsequenceBuilder.java:130)
| Error at org.drools.compiler.rule.builder.RuleBuilder.build(RuleBuilder.java:103)
| Error at org.drools.compiler.compiler.PackageBuilder.addRule(PackageBuilder.java:3160)
| Error at org.drools.compiler.compiler.PackageBuilder.compileRules(PackageBuilder.java:1047)
| Error at org.drools.compiler.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:952)
| Error at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildRules(CompositeKnowledgeBuilderImpl.java:231)
| Error at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildPackages(CompositeKnowledgeBuilderImpl.java:86)
| Error at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:75)
| Error at org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:201)
| Error at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:39)
| Error at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:305)
| Error at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:187)
| Error at com.iterranux.droolsjbpmCore.runtime.build.impl.KieModuleBuilder.buildKmoduleForGrailsModule(KieModuleBuilder.java:127)
| Error at com.iterranux.droolsjbpmCore.runtime.build.impl.KieModuleBuilder.buildKmoduleForGrailsModule(KieModuleBuilder.java:148)
| Error at com.iterranux.droolsjbpmCore.runtime.build.impl.KieModuleBuilder$buildKmoduleForGrailsModule.call(Unknown Source)
| Error at DroolsjbpmCoreGrailsPlugin$_closure7.doCall(DroolsjbpmCoreGrailsPlugin.groovy:386)
| Error at sun.reflect.GeneratedMethodAccessor992.invoke(Unknown Source)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.ri.OriginalClassInvoker.invoke(OriginalClassInvoker.java:47)
| Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1283)
| Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error at groovy.lang.Closure.call(Closure.java:411)
| Error at DroolsjbpmCoreGrailsPlugin$_closure7.call(DroolsjbpmCoreGrailsPlugin.groovy)
| Error at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.invokeOnChangeListener(DefaultGrailsPlugin.java:767)
| Error at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:716)
| Error at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:731)
| Error at org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager.informOfClassChange(AbstractGrailsPluginManager.java:406)
| Error at org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager.informOfFileChange(AbstractGrailsPluginManager.java:367)
| Error at org.codehaus.groovy.grails.compiler.GrailsProjectWatcher.informPluginManager(GrailsProjectWatcher.java:243)
| Error at org.codehaus.groovy.grails.compiler.GrailsProjectWatcher.access$400(GrailsProjectWatcher.java:46)
| Error at org.codehaus.groovy.grails.compiler.GrailsProjectWatcher$1.onChange(GrailsProjectWatcher.java:154)
| Error at org.codehaus.groovy.grails.compiler.DirectoryWatcher.fireOnChange(DirectoryWatcher.java:174)
| Error at org.codehaus.groovy.grails.compiler.DirectoryWatcher.run(DirectoryWatcher.java:156)
| Error at org.codehaus.groovy.grails.compiler.GrailsProjectWatcher.run(GrailsProjectWatcher.java:178)
| Error at java_lang_Runnable$run.call(Unknown Source)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
| Error at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.startProjectWatcher(ForkedGrailsProcess.groovy:702)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
| Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
| Error at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_setupReloading_closure16.doCall(ForkedGrailsProcess.groovy:691)
| Error at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_setupReloading_closure16.doCall(ForkedGrailsProcess.groovy)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
| Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error at groovy.lang.Closure.call(Closure.java:411)
| Error at groovy.lang.Closure.call(Closure.java:405)
| Error at groovy.lang.Closure.run(Closure.java:492)
| Error at java.lang.Thread.run(Thread.java:722)
| Error Caused by: org.springsource.loaded.ReloadException: Problem defining class com.iterranux.droolsjbpmHumanTask.domain.team__I
| Error at org.springsource.loaded.TypeRegistry.defineClass(TypeRegistry.java:1076)
| Error at org.springsource.loaded.ReloadableType.rewriteCallSitesAndDefine(ReloadableType.java:807)
| Error at org.springsource.loaded.ReloadableType.<init>(ReloadableType.java:151)
| Error at org.springsource.loaded.TypeRegistry.addType(TypeRegistry.java:889)
| Error at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:246)
| Error at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:102)
| Error ... 114 more
| Error Caused by: java.lang.reflect.InvocationTargetException
| Error at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.TypeRegistry.defineClass(TypeRegistry.java:1071)
| Error ... 119 more
| Error Caused by: java.lang.NoClassDefFoundError: com/iterranux/droolsjbpmHumanTask/domain/team__I (wrong name: com/iterranux/droolsjbpmHumanTask/domain/Team__I)
| Error at java.lang.ClassLoader.defineClass1(Native Method)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
| Error ... 123 more
12 years, 4 months
Drools Perm gen grows constantly
by pmander
Fairly new to drools here but we are using it on a standalone application to
do some batch processing. The application is spring based and
single-threaded. I am using a single stateful session that I build around
15,000 rules dynamically on process startup.
The application then receives a message to process a set of records through
the rules and write out the results. To do this I insert the data as facts
and run a query to get the results. I must then remove all the facts that I
created and also all the object that where created by the rules so that the
session can be used for the next batch of records.
This works fine and meets our performance requirements. However, after a
time the process fails and upon investigation this is due to the perm gen
space filling up with classes. The heap itself is fine and steady by the
number of classes in the JVM keeps growing. These classes are all
DefaultConsequenceInvokerGenerated classes appear to be created when my new
facts are inserted.
This is running on a 1.7 oracle JVM and I've tried -XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled but nothing helps.
So is this expected behaviour? Is there an issue with how I am using drools?
Any help much appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Perm-gen-grows-constantly-tp4026...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Info on Drools 6 documentation
by Gianvicenzo CAPUTO
Hello,
It seems to me that the documentation of Drools Guvnor 6.0.0 RC5 does
not correspond to the web interface I see.
Is that me or there is indeed a discrepancy? In the latter case anyone
knows when the updated doc will be available? the final release
probably?
Thanks for your help.
V.
12 years, 4 months
Usage of Drools Configuration Attributes
by Arul Prashanth
Anyone know what these options are for and does this configuration help in
reducing the rule execution time and memory usage. I couldn't find much
details on these option apart from few like maintainTMS and shareAlphaNodes.
drools.maintainTms
drools.assertBehaviour
drools.logicalOverride
drools.sequential
drools.sequential.agenda
drools.removeIdentities
drools.shareAlphaNodes
drools.shareBetaNodes
drools.alphaNodeHashingThreshold
drools.compositeKeyDepth
drools.indexLeftBetaMemory
drools.indexRightBetaMemory
drools.consequenceExceptionHandler
drools.mbeans
Are there any optimal values to improve performance.
-----
- Prashanth
--
View this message in context: http://drools.46999.n3.nabble.com/Usage-of-Drools-Configuration-Attribute...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Equal shift assignment based on employment form
by ns
Hi,
I would like to distribute shifts equally among employees based on their
employment form (full time or part time: 100%, 75%, 50%, ...). I have a
variable for each employee that holds the employment form. How do I make
sure all shifts get distributed equally, so that somebody that works 50% of
the time only gets half the shifts assigned than someone who works 100%.
And how do I make sure shifts that employee need to do are distributed
equally over time. So for example we have 20 shifts a month and 5 employees.
How do I make sure I get a plan like e1, e2, e3, e4, e5, e1, e2, e3, e4, e5,
... Instead of e1, e1, e1, e1, e1, e2, e2, e2, e2, e2. Thanks.
Kind regards,
Nick
--
View this message in context: http://drools.46999.n3.nabble.com/Equal-shift-assignment-based-on-employm...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Drools 5.5 Property Reactive on Maps
by gboro54
So I have an object with a map like follows:
protected ConcurrentMap<String, Double> accumulations = new
ConcurrentHashMap<String, Double>();
I wrote a convince method on the class that will look up the value in the
map and add to it if it exists and
if not there will put it in the map:
@Modifies({ "accumulations " })
public void addToAccumulation(String code, long volume) {
if (accumulations .containsKey(code)) {
Double value = accumulations .get(code) + volume;
accumulations .put(code, value);
} else {
accumulations .putIfAbsent(code, new Double(volume));
}
}
I have a rule to listen on the change of this filed on the object(i.e
accumulations["someCode"]!=null) but
when I modify the object the rule doesn't fire. I have added
@PropertyReactive to the Object and build the kbase as follows:
Properties props = new Properties();
props.setProperty("drools.dialect.java.compiler", "JANINO");
KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory
.newKnowledgeBuilderConfiguration(props);
config.setOption(PropertySpecificOption.ALWAYS);
Any insight into why this may not work?
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-5-Property-Reactive-on-Maps-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
How can I iterate through the ArrayList
by Govind J. Parashar
HI,
I have a AwaitingActionList Object which has a awaitingActionsList Object which has a ArrayList of AwaitingAction Objects. How can I iterate through the ArrayList to get to check each object AwaitingAction .value in the drl file.
Java refrence file attached
Thanks
Govind
MASTEK LTD.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 years, 4 months
iterate through the ArrayList
by Govind J. Parashar
Hi all
I have Class A which has a one attribute
private List<B> obj = new ArrayList<B>();
Class B which has a one attribute
Status
Value
How can I iterate through the ArrayList (i.e obj) to get to check each object B . Status=='True' the set Value=true in the drl file.
Thanks
Govind
MASTEK LTD.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 years, 4 months