Re: [rules-users] Loading pre-compiled rules (kbase.cache)

2014-08-25 Thread darktyco
I posted a similar question on the new google group forum today:

https://groups.google.com/forum/#!topic/drools-setup/aEG1s8MqgA0

The KieServicesImpl class lives in the drools-compiler jar file so I don't
believe the compiler jar can be removed from the classpath. In my case that
is fine but I don't think that the pre-compiled rules are loading at all and
I am using code that is very similar to yours. Did you ever find a
resolution for this?

Thanks,
Kyle



--
View this message in context: 
http://drools.46999.n3.nabble.com/Loading-pre-compiled-rules-kbase-cache-tp4029397p4030715.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools 5.2 - 5.5 problems

2013-02-08 Thread darktyco
Hey everyone,

I have been running Drools 5.2 for a long time now and decided to try out
Drools 5.5 to see what was new. I felt that 5.2 was always a bit of a memory
hog so I was hoping that 5.5 would be better, however it seems to have
gotten worse. Previously I could run my company's test suite with -Xmx1024m
-XX:MaxPermSize=256m. Now I get:

[Error: Java heap space]
[Near : {... MyDomainObject != CE }]
 ^
[Line: 1, Column: 1]
at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:308)
at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
at org.mvel2.MVEL.compileExpression(MVEL.java:810)
at
org.drools.base.mvel.MVELCompilationUnit.compile(MVELCompilationUnit.java:435)
at
org.drools.base.mvel.MVELCompilationUnit.getCompiledExpression(MVELCompilationUnit.java:238)
at
org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:206)
at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:190)
at
org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:157)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at 
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at 
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at
my.company.KnowledgeBaseStatelessRuleEngine.execute(KnowledgeBaseStatelessRuleEngine.java:48)

I incrementally increased the max heap size in steps of 500m to see when the
heap error would go away and I had to go all the way up to 4000m. Is it
common knowledge that Drools requires more memory since 5.5? Is there
anything our rules could possibly be doing wrong that the newer versions
don't like?

Once I do get the tests running, I am getting a lot of errors about a
comparison to a string with the value of null:

Exception executing consequence for rule SomeRule_39 in
my.company.user.rules: [Error: incompatible types in statement: class
java.lang.String (compared from: class
my.company.userdata.intermediate.numbers.TotalScore)]
[Near : {... this != null }]
 ^
[Line: 1, Column: 1]
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at 
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1297)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1221)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1456)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)
at
my.company.commons.rules.util.KnowledgeBaseStatelessRuleEngine.execute(KnowledgeBaseStatelessRuleEngine.java:49)

Caused by: [Error: incompatible types in statement: class java.lang.String
(compared from: class my.company.userdata.intermediate.numbers.TotalScore)]
[Near : {... this != null }]
 ^
[Line: 1, Column: 1]
at org.mvel2.ast.BinaryOperation.init(BinaryOperation.java:84)
at org.mvel2.util.CompilerTools.finalizePayload(CompilerTools.java:118)
at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:287)
at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
at org.mvel2.MVEL.compileExpression(MVEL.java:810)
at
org.drools.base.mvel.MVELCompilationUnit.compile(MVELCompilationUnit.java:435)
at
org.drools.base.mvel.MVELCompilationUnit.getCompiledExpression(MVELCompilationUnit.java:238)
at
org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:206)
at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:190)
at

Re: [rules-users] Help! Activations firing out of salience order

2011-10-19 Thread darktyco
I had to upgrade to 5.2 to get away from the same salience bug. So far 5.2
has been very good to us other than the outrageous amount of memory it takes
to load up a large rule base (which you can partially get around using the
latest mvel jar).

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Help-Activations-firing-out-of-salience-order-tp3430611p3435291.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools 5.2 performance building KnowledgeBase

2011-08-24 Thread darktyco
I got it directly from the MVEL Web site:

http://mvel.codehaus.org/Downloading+MVEL
http://mvel.codehaus.org/Downloading+MVEL 

Good luck! Hopefully this version, or an even better one, will be included
with Drools 5.3 final.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-5-2-performance-building-KnowledgeBase-tp3239746p3282765.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools 5.2 performance building KnowledgeBase

2011-08-24 Thread darktyco
I forgot to answer your other question: I'm on Drools 5.2. I had tried the
Drools 5.3 Beta 1 distribution but there was no improvement- it seems
something was fixed specifically in MVEL 2.1 Beta6.

Also, to Thomas: I have to specify -Xmx512m in order to run a pretty bare
minimum unit test (this does include a Spring application context but it is
very small) using this Drools setup to run or I will get an OOM Java Heap
exception within seconds. It is actually kind of strange how quickly the
exception is thrown. I will double check the 512 figure and get back to you
if I can indeed get it to run with less memory, I really dislike spreading
bad info around. The full Webapp needs more than that plus a MaxPermSize
increase, but there is a lot of other stuff going on in the war.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-5-2-performance-building-KnowledgeBase-tp3239746p3282810.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools 5.2 performance building KnowledgeBase

2011-08-09 Thread darktyco
Has anyone out there experienced any slowdowns using Drools 5.2 to build a
knowledge base? I have around 700 drl files (containing anywhere from 1 to
30 rules each) and the time to build a KnowledgeBase with them has increased
from about 10 minutes in Drools 5.1 to 90 minutes in Drools 5.2. I realize I
have a slow computer here, but the time difference between the two versions
is staggering. 

I have already been serializing the KnowledgeBase object for performance
reasons and even loading the serialized KnowledgeBase takes about 3-4x
longer in 5.2 than in 5.1. Am I doing something wrong here? Here are some
code snippets of how I am building and loading the kbase: 

 Building 
final KnowledgeBuilder kBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(); 
final ListFile drlFiles = getAllDrlFiles(directory); 
for (final File name : drlFiles) { 
kBuilder.add(ResourceFactory.newFileResource(name),
ResourceType.DRL); 
} 
if (kBuilder.hasErrors()) { 
//  
} 
final KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase(); 
kBase.addKnowledgePackages(kBuilder.getKnowledgePackages()); 
ObjectOutputStream oos = null; 
try { 
oos = new DroolsObjectOutputStream(new FileOutputStream(pkgFile)); 
oos.writeObject(kBase); 
} catch (...) { 
//  
} 

 Loading 
ois = new DroolsObjectInputStream(new FileInputStream(pkgFile)); 
final KnowledgeBase kBase = (KnowledgeBase) ois.readObject(); 
final StatefulKnowledgeSession ksession =
kBase.newStatefulKnowledgeSession(); 

Thanks!

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-5-2-performance-building-KnowledgeBase-tp3239746p3239746.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users