[rules-users] stuck! Unknown accessor type: org.mvel2.optimizers.impl.refl.collection.ArrayCreator at 690c2a7a

Mario Fusco mario.fusco at gmail.com
Thu Jan 23 04:19:46 EST 2014


A quick premise: in Drools 5.5 we introduced a mechanism to compile
constraints, i.e. something that translates constraints in bytecode in order
to evaluate them in compiled mode, instead of being interpreted by mvel, and
then make this evaluation faster.

That warning means that for your specific constraint this compilation
process fails. When this happens drools keeps working correctly because the
compiled constraint is just discarded and the constraint is evaluated in
interpreted mode as usual. As I said the only drawback is that this
interpreted evaluation is a bit slower than the compiled one.

I reproduced this problem and found that indeed drools is at the moment
unable to compile a constraint containing an array creation. I am working to
fix this issue just now. 

Note anyway that this problem only (marginally) affects performances and not
correctness. However, if you want to workaround this problem, my suggestion
is to replace, where possible, the array with a vararg. For instance you
could modify the signature of that Operators.contains as it follows

boolean contains(String s, String... array) { ... }

This will also have a nice effect on your drl so you could now rewrite the
constraint just as:

Operators.contains(LoanProgramName, "2008 Temporary Loan Limits")

and I just checked that doing so will also allow drools to correctly compile
it.

I hope this helps,
Mario



--
View this message in context: http://drools.46999.n3.nabble.com/stuck-Unknown-accessor-type-org-mvel2-optimizers-impl-refl-collection-ArrayCreator-690c2a7a-tp4020969p4027817.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list