-
Bug
-
Resolution: Done
-
Minor
-
6.4.0.Final
-
None
-
Workaround Exists
-
-
NEW
-
NEW
Hello, for a large number of evaluations a ClassNotFoundException is thrown missing to find appropriate class for the drools function defined.
In the attached reproducer, a for loop inserts a given number of facts into the session; for a small number of facts, no error is thrown.
For example given
for (int i=0; i<20; i++) { session.insert("Ciao "+i); session.fireAllRules(); }
all is fine.
When running with say:
for (int i=0; i<150; i++) { session.insert("Ciao "+i); session.fireAllRules(); }
then throws, snippet:
java.lang.NoClassDefFoundError: com/acme/testjitfunction/EntryKey$1 at com.acme.testjitfunction.EntryKey.entryKey(EntryKey.java:51) at ConditionEvaluator1fae754676b54e869aa5b558ba2d7991.evaluate(Unknown Source) at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:258) at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:214) at org.drools.core.phreak.PhreakAccumulateNode.evaluateResultConstraints(PhreakAccumulateNode.java:696) at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:114) at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:534) [...] Caused by: java.lang.ClassNotFoundException: com.acme.testjitfunction.EntryKey$1 at java.lang.ClassLoader.findClass(ClassLoader.java:530) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at org.drools.core.common.ProjectClassLoader$DefaultInternalTypesClassLoader.loadType(ProjectClassLoader.java:393) at org.drools.core.common.ProjectClassLoader$DefaultInternalTypesClassLoader.loadClass(ProjectClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 44 more
I'm also wondering if maybe this is not the best possible way to "backport" lambdas as a drool function; in case a more proper way to implement them as a drool function is possible, kindly let me know.
Can you kindly advise, please?
Thank you very much
Ciao
MM