[JBoss JIRA] Created: (JBRULES-2169) CLONE -issue with using contains operator on array or collection of double (any )
by Neil Wallace (JIRA)
CLONE -issue with using contains operator on array or collection of double (any )
---------------------------------------------------------------------------------
Key: JBRULES-2169
URL: https://jira.jboss.org/jira/browse/JBRULES-2169
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 4.0.7, 5.0.0.M3
Environment: Windows XP service pack2
Reporter: Neil Wallace
Assignee: Mark Proctor
Fix For: 5.0.1.FINAL
When using 'contains' operator on array or collection of strings its working fine. But when we use it for an array of primitive type double it gives a classcastexception . Is auto boxing not supported? May be this is fine as it mentioned in the documentation that it works only on Objects. I tried using the array of Double objects, here it doesn't throw an excpetion but the rule wasn't firing. The behaviour was same even if I use a collection of Double objects.
ex:
using Array
rule "OrderArray"
when
Order(valueArray contains 0)
then
System.out.println("OrderArray");
end.
using Collection
rule "OrderList"
when
Order(valueList contains 0)
then
System.out.println("OrderList");
end.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years
[JBoss JIRA] Created: (JBRULES-2168) CLONE -Deserializing a KnowledgeBase object throws a java.io.EOFException
by Neil Wallace (JIRA)
CLONE -Deserializing a KnowledgeBase object throws a java.io.EOFException
-------------------------------------------------------------------------
Key: JBRULES-2168
URL: https://jira.jboss.org/jira/browse/JBRULES-2168
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.0.0.M4, 5.0.0.M5
Environment: Ubuntu 8.10
Reporter: Neil Wallace
Assignee: Edson Tirelli
Fix For: 5.0.1.FINAL
A java.io.EOFException is thrown when reading a serialized KnowledgeBase object from a file.
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
at org.drools.common.DroolsObjectInputStream.<init>(DroolsObjectInputStream.java:55)
at org.drools.common.DroolsObjectInputStream.<init>(DroolsObjectInputStream.java:49)
at org.drools.common.AbstractRuleBase.readExternal(AbstractRuleBase.java:227)
at org.drools.reteoo.ReteooRuleBase.readExternal(ReteooRuleBase.java:173)
at org.drools.impl.KnowledgeBaseImpl.readExternal(KnowledgeBaseImpl.java:83)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at com.sample.DroolsTest.read(DroolsTest.java:75)
at com.sample.DroolsTest.testIO(DroolsTest.java:50)
at com.sample.DroolsTest.main(DroolsTest.java:40)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years
[JBoss JIRA] Created: (JBRULES-2167) CLONE -Deadlock when RuleAgent thread refreshes rules while another thread creates a statefulSession
by Neil Wallace (JIRA)
CLONE -Deadlock when RuleAgent thread refreshes rules while another thread creates a statefulSession
----------------------------------------------------------------------------------------------------
Key: JBRULES-2167
URL: https://jira.jboss.org/jira/browse/JBRULES-2167
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 4.0.7
Environment: Windows XP SP3
Sun JRE 1.5.0_14
Reporter: Neil Wallace
Assignee: Mark Proctor
Fix For: 5.0.1.FINAL
I believe I have discovered a deadlock that can occur in drools 4.0.7 if the RuleAgent refreshes its associated RuleBase whilst a new stateful session is being created on the RuleBase by another thread.
The thread dump below shows the deadlock where the two thread "Timer-15" and "DataSource(com.acme.Source)-2" are deadlocked. Thread "Timer-15" is the timer thread created by the RuleAgent rule refresh mechanism to check if the rules files have changed, and to refresh the rules when a change is found. If it finds changes to the rules then it obtains a lock (<0x189a8d88> (a java.util.HashMap)) and proceeds to removes the old version of the changed package from the RuleBase. To do this it needs to obtain another lock (<0x189a2ba0> (a org.drools.reteoo.ReteooRuleBase)) before it can call removeRule.
However, in another thread "DataSource(com.acme.Source)-2" a new stateful session is being created on the same RuleBase. This has already obtained the lock (<0x189a8d88> (a java.util.HashMap)) that the Timer thread is waiting for, and is itself waiting for the another lock <0x189a2ba0> (a org.drools.reteoo.ReteooRuleBase) that the Timer thread has already locked, hence the deadlock.
In my own application I coded around this by eventually not using the RuleAgent in-built refresh mechanism, but instead periodically calling refreshRuleBase() on the RuleAgent in the SAME thread used to create the Stateful session, thus avoiding any deadlock.
"Timer-15" daemon prio=6 tid=0x02f4b0e8 nid=0x1864 waiting for monitor entry [0x038cf000..0x038cfa68]
at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:270)
- waiting to lock <0x189a2ba0> (a org.drools.reteoo.ReteooRuleBase)
at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:656)
at org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:570)
- locked <0x189a8d88> (a java.util.HashMap)
at org.drools.agent.PackageProvider.removePackage(PackageProvider.java:45)
at org.drools.agent.PackageProvider.applyChanges(PackageProvider.java:63)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:320)
at org.drools.agent.RuleAgent$2.run(RuleAgent.java:438)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
"DataSource(com.acme.Source)-2" daemon prio=4 tid=0x03027610 nid=0xfac waiting for monitor entry [0x0378f000..0x0378fb68]
at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:225)
- waiting to lock <0x189a8d88> (a java.util.HashMap)
- locked <0x189a2ba0> (a org.drools.reteoo.ReteooRuleBase)
at org.drools.common.AbstractRuleBase.newStatefulSession(AbstractRuleBase.java:284)
at com.acme.RunRules.flush(RunRules.java:3337)
at com.acme.ControlThread.run(ControlThread.java:465)
at java.lang.Thread.run(Unknown Source)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years
[JBoss JIRA] Created: (JBRULES-2165) CLONE -RulebasePartitioningTest test failure
by Neil Wallace (JIRA)
CLONE -RulebasePartitioningTest test failure
---------------------------------------------
Key: JBRULES-2165
URL: https://jira.jboss.org/jira/browse/JBRULES-2165
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-guvnor
Affects Versions: 5.0.0.M2
Reporter: Neil Wallace
Assignee: Mark Proctor
Fix For: 5.0.1.FINAL
unit test failure when building MR2 source code
This works if config.setMultithreadEvaluation( true ); line commented out
-------------------------------------------------------------------------------
Test set: org.drools.integrationtests.RulebasePartitioningTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.15 sec <<< FAILURE!
testRulebasePartitions1(org.drools.integrationtests.RulebasePartitioningTest) Time elapsed: 0.14 sec <<< FAILURE!
junit.framework.AssertionFailedError: expected:<3> but was:<0>
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.failNotEquals(Assert.java:282)
at junit.framework.Assert.assertEquals(Assert.java:64)
at junit.framework.Assert.assertEquals(Assert.java:201)
at junit.framework.Assert.assertEquals(Assert.java:207)
at org.drools.integrationtests.RulebasePartitioningTest.testRulebasePartitions1(RulebasePartitioningTest.java:82)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years
[JBoss JIRA] Created: (JBRULES-2162) CLONE -Issue in Drools 4.0.7 when run in Multithreaded environment
by Neil Wallace (JIRA)
CLONE -Issue in Drools 4.0.7 when run in Multithreaded environment
------------------------------------------------------------------
Key: JBRULES-2162
URL: https://jira.jboss.org/jira/browse/JBRULES-2162
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.7
Environment: OS AIX 1.5
Reporter: Neil Wallace
Assignee: Edson Tirelli
Fix For: 5.0.1.FINAL
Hi
We have a batch program(Informatica mapping) which uses Jars taken from an application which uses JBoss Drools 4.0.7 and MVEL 1.3.7. The informatica Integration service runs in AIX Machine with JRE Version 1.5. The batch program process millions of records which in turn calls the Drools API. To improve the performance, we tried running our informatica process in a multi threaded environment(4 threads). While running we got the following exception for every record that we process(across all the threads).
: Exception executing predicate eval( $terDate.before(ExtDateTimeUtils.getDate("01/01/1900")) )
at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
at org.drools.reteoo.Rete.assertObject(Rete.java:175)
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:911)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
at org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:160)
at com.wellpoint.eps.epds.business.framework.rules.jbrules.JBRulesExecutor.fireAllRules(JBRulesExecutor.java:85)
at com.wellpoint.eps.epds.business.framework.validation.BaseHandlerImpl.validateInternal(BaseHandlerImpl.java:141)
at com.wellpoint.eps.epds.business.framework.validation.BaseHandlerImpl.validateInternal(BaseHandlerImpl.java:75)
at com.wellpoint.eps.epds.business.framework.validation.AbstractBusinessRuleHandler.validate(AbstractBusinessRuleHandler.java:43)
at com.wellpoint.eps.epds.business.application.validation.ProviderContractBusinessRuleHandler.validate(ProviderContractBusinessRuleHandler.java:43)
at com.wellpoint.eps.epds.business.framework.service.DefaultRuleValidationServiceImpl.applyBusinessRules(DefaultRuleValidationServiceImpl.java:284)
at com.eps.epds.api.validation.ValidationServiceDeligator$DefaultValidationServiceImpl.validate(ValidationServiceDeligator.java:181)
at com.informatica.powercenter.server.jtx.JTXPartitionDriverImplGen.inputTransaction(JTXPartitionDriverImplGen.java:1414)
Caused by: org.mvel.CompileException: cannot invoke method
at org.mvel.optimizers.impl.refl.MethodAccessor.getValue(MethodAccessor.java:54)
at org.mvel.optimizers.impl.refl.VariableAccessor.getValue(VariableAccessor.java:39)
at org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
at org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
at org.mvel.MVEL.executeExpression(MVEL.java:235)
at org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209)
... 20 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.mvel.optimizers.impl.refl.MethodAccessor.getValue(MethodAccessor.java:46)
... 28 more
Caused by: java.lang.NullPointerException
at java.util.Date.getMillisOf(Date.java:953)
at java.util.Date.before(Date.java:912)
... 32 more
].
Could you please let me know if this is a known issue or is there any workaround for this problem?
Thanks
Sitaraman
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years
[JBoss JIRA] Created: (JBRULES-2161) CLONE -Prefix 'and' and infix 'and' not interchangeable
by Neil Wallace (JIRA)
CLONE -Prefix 'and' and infix 'and' not interchangeable
-------------------------------------------------------
Key: JBRULES-2161
URL: https://jira.jboss.org/jira/browse/JBRULES-2161
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 4.0.2
Reporter: Neil Wallace
Assignee: Edson Tirelli
Fix For: 5.0.1.FINAL
The documentation on the 'and' Conditional Element seems to imply that these constructs are equivalent:
$p1:Entity($code1:code)
not (and
$p2:Entity(code == $code1)
eval(MyStaticClass.match($p1, $p2))
)
$p1:Entity($code1:code)
not (
$p2:Entity(code == $code1)
and eval(MyStaticClass.match($p1, $p2))
)
Actually, the first version crashes with this message:
unknown:93:7 Unexpected token 'and'[96,2]: unknown:96:2 mismatched token: [@792,3685:3685=')',<12>,96:2]; expecting type THEN
I'm on drools 4.0.2 and mvel14-1.2.8.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years