[rules-users] Mvel and multithreading

Grigoriev, Grigoriy Grigoriy.Grigoriev at t-systems.ru
Tue Nov 10 03:06:53 EST 2009


Hello,

I have a project, that uses Drools 5.0.1. I have a class, called RuleFlowProcessor, that's used to apply some of my rules to the objects.
The instances of RuleFlowProcessor with the identical configuration should be used by different threads, and i use following mechanism:
I initialize one instance of RuleFlowProcessor, and the threads take copy of this instance, calling the 'clone()' method, which is not synchronized, and in which I just create new instance of
RuleFlowProcessor and init it, using the same data.

And therefore I get an exception:

Exception in thread "Thread-91" [Error: incomplete statement:  (possible use of reserved keyword as identifier: )]
[Near : {... globals != empt ....}]
                      ^
[Line: 0, Column: 0]
            at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:153)
            at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:44)
            at org.mvel2.MVEL.eval(MVEL.java:514)

although, all the resources (.drl and .rf files) are parsed perfectly, when I use just one thread.

In actions of my ruleflow, the dialect: 'mvel' was set by default, if I set dialect to 'java' without modifying any code, the error doesn't occur.

The full stacktrace is in attach. I can send the project, that reproduces the problem, if needed.

Best regards,
Grigoriy Grigoriev.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091110/fcf9f86a/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stacktrace.txt
Url: http://lists.jboss.org/pipermail/rules-users/attachments/20091110/fcf9f86a/attachment.txt 


More information about the rules-users mailing list