[jboss-jira] [JBoss JIRA] (DROOLS-1166) ClassNotFoundException for the drools function when large number of valuations

Matteo Mortari (JIRA) issues at jboss.org
Thu May 5 05:06:00 EDT 2016


Matteo Mortari created DROOLS-1166:
--------------------------------------

             Summary: ClassNotFoundException for the drools function when large number of valuations
                 Key: DROOLS-1166
                 URL: https://issues.jboss.org/browse/DROOLS-1166
             Project: Drools
          Issue Type: Bug
          Components: core engine
    Affects Versions: 6.4.0.Final
            Reporter: Matteo Mortari
            Assignee: Mario Fusco
            Priority: Minor
         Attachments: 20160505.testjitfunction.zip

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 
{code}
for (int i=0; i<20; i++) {
	session.insert("Ciao "+i);
	session.fireAllRules();
}
{code}
all is fine.

When running with say:
{code}
for (int i=0; i<150; i++) {
	session.insert("Ciao "+i);
	session.fireAllRules();
}
{code}
then throws, snippet:
{code}
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
{code}

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



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list