Hi,
usings Drools 4.0.4 and MVEL 1.4, this simple rule:
---
package test;
import java.util.Collections;
dialect "mvel"
rule "Rule #1"
when
then
insert(Collections.singletonMap("content", "hello"));
end
--
produces:
java.lang.IllegalAccessError: class
org.drools.shadow.java.util.Collections$SingletonMapShadowProxy cannot
access its superclass java.util.Collections$SingletonMap
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:60)
at org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:79)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.drools.reteoo.Rete$ClassObjectTypeConf.loadOrGenerateProxy(Rete.java:547)
at
org.drools.reteoo.Rete$ClassObjectTypeConf.defineShadowProxyData(Rete.java:494)
at org.drools.reteoo.Rete$ClassObjectTypeConf.<init>(Rete.java:461)
at org.drools.reteoo.Rete.assertObject(Rete.java:152)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:909)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:881)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:67)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:61)
It's not clear to me why Drools creates Proxies for such classes as
java.util.Collections, or does MVEL do it?
- Godmar