[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1330) Using RuleBase in multithread application server environment
Edson Tirelli (JIRA)
jira-events at lists.jboss.org
Wed Feb 20 16:39:42 EST 2008
[ http://jira.jboss.com/jira/browse/JBRULES-1330?page=comments#action_12400096 ]
Edson Tirelli commented on JBRULES-1330:
----------------------------------------
Ok, I was able to reproduce the problem you mentioned when I used the wrong MVEL version. When I switched to MVEL 1.2.20, I got the same exception you had:
[etirelli at localhost jira-1330]$ cp ~/.m2/repository/org/mvel/mvel14/1.2.20/mvel14-1.2.20.jar lib
[etirelli at localhost jira-1330]$ mv lib/mvel14-1.2.21.jar .
[etirelli at localhost jira-1330]$ ant run-dst
Buildfile: build.xml
run-dst:
[java] JVM args ignored when same JVM is used.
[java] INFO : 2008-02-20 18:35:00,916 ruleslog:120 Got Input Stream:true
[java] org.mvel.CompileException: can not resolve identifier: name
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:180)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[java] at org.apache.tools.ant.Task.perform(Task.java:364)
[java] at org.apache.tools.ant.Target.execute(Target.java:341)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
[java] Caused by: org.mvel.CompileException: can not resolve identifier: name
[java] at org.mvel.ASTNode.getReducedValue(ASTNode.java:315)
[java] at org.mvel.ast.PropertyASTNode.getReducedValue(PropertyASTNode.java:34)
[java] at org.mvel.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:115)
[java] at org.mvel.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:63)
[java] at org.mvel.TemplateInterpreter.execute(TemplateInterpreter.java:409)
[java] at org.mvel.TemplateInterpreter.execute(TemplateInterpreter.java:342)
[java] at org.mvel.TemplateInterpreter.eval(TemplateInterpreter.java:108)
[java] at org.mvel.TemplateInterpreter.evalToString(TemplateInterpreter.java:73)
[java] at org.drools.rule.builder.dialect.java.JavaFunctionBuilder.build(JavaFunctionBuilder.java:96)
[java] at org.drools.rule.builder.dialect.java.JavaDialect.addFunction(JavaDialect.java:436)
[java] at org.drools.compiler.PackageBuilder.addFunction(PackageBuilder.java:406)
[java] at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:289)
[java] at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
[java] at com.test.drools.TestRulesMT.buildRuleBase(TestRulesMT.java:109)
[java] at com.test.drools.TestRulesMT.main(TestRulesMT.java:34)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:202)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:134)
[java] ... 15 more
Please make sure you are using MVEL 1.2.21.
I'm closing this ticket. If you still has problems with MVEL 1.2.21, plz re-open the ticket and provide any additional info you may have.
Thanks,
Edson
> Using RuleBase in multithread application server environment
> ------------------------------------------------------------
>
> Key: JBRULES-1330
> URL: http://jira.jboss.com/jira/browse/JBRULES-1330
> Project: JBoss Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Rule Flow
> Affects Versions: 4.0.3
> Environment: Red Hat Linux as OS, weblogic 9.2 using jrockit-1.5.0_10
> Reporter: Navaljit Bhasin
> Assigned To: Edson Tirelli
> Fix For: 5.0.0-M1, 4.0.5
>
> Attachments: Droolsmt.zip, log.txt
>
>
> We are deploying an applcation which has one major component which executes rules.
> At the startup of the application server, we load the various rules and save them in a hashmap with appropriate key. The value of these HashMaps is RuleBase. This is part of a singleton service.
> The applcation is based on JMS. A MDB receives message, calls the sigleton service to get stateful session from a specific RuleBase ( saved in HashMap by key as mentioned above). This singleton service get the RuleBase from Map, call newStatefulSession(false) on this RuleBase object and return the new StatefulSession.
> This works fine as long as we have one MDB on the application server. When we increase the number of MDB's to more than one, and both MDB's process the messages( different messages) simultaneously, the results from stateful session rule firing are messed up. It skips amny valid LHS and so on.
> I even tried using the Stateless Session, but the results are still messed up. So my question is:
> Can we use the Rulebase in multithreaded environment ? My understanding was that we can use it. There should be no interaction between various stateful sessions received from same rulebase object. If we can't use it this way, the we have build it form PackageBuilder for every invocation. There are lots of complex rules and for hundreds of calls it adds up to considerable waste of resources.
> Thanks for reading this bug report
> Can you please post or email me the code to use the statefule sessions from a RuleBase object in multithreaded environment?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list