[JBoss JIRA] Created: (JBRULES-3061) Compiler error on 5.2.0.CR1. Worked on 5.0.1
by Joe White (JIRA)
Compiler error on 5.2.0.CR1. Worked on 5.0.1
--------------------------------------------
Key: JBRULES-3061
URL: https://issues.jboss.org/browse/JBRULES-3061
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 5.2.0.CR1
Environment: Java 5. Windows. Drools Master branch
Reporter: Joe White
Assignee: Mark Proctor
The test below can be added directly to MiscTest in drools-compiler and run to reproduce the problem. The exception that occurs is pasted below the rule. If there is only one check in the Person object then the rule will compile, but adding in the part with "|| status != $inStatus" causes the exception.
######################TEST#################################
@Test
public void testMapVarCompare() {
//
String str = "";
str += "package org.drools\n";
str += "import org.drools.Person\n";
str += "import java.util.Map\n";
str += "import java.util.List\n";
str += "rule rule1 \n";
str += "when\n";
str += " $listOfMaps : List()\n";
str += " Map($inName : this['name'], $inStatus : this['STATUS']) from $listOfMaps\n";
str += " Person( name != $inName || status != $inStatus)\n";
str += "then\n";
str += "end\n";
try {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newByteArrayResource( str.getBytes() ),
ResourceType.DRL );
if ( kbuilder.hasErrors() ) {
System.out.println(kbuilder.getErrors());
fail( "KnowledgeBuilder should not have errors" );
}
} catch ( Exception e ) {
e.printStackTrace();
fail( "Exception should not be thrown " );
}
}
################################EXCEPTION##################################################
Unable to build expression for 'inline-eval' : [Error: incompatible types in statement: class java.lang.Object (compared from: class java.lang.String)]
[Near : {... name != $inName || status != $ ....}]
^
[Line: 1, Column: 1]'name != $inName || status != $inStatus'
[Error: incompatible types in statement: class java.lang.Object (compared from: class java.lang.String)]
[Near : {... name != $inName || status != $ ....}]
^
[Line: 1, Column: 1] : [Rule name='rule1']
[Error: incompatible types in statement: class java.lang.Object (compared from: class java.lang.String)]
[Near : {... name != $inName || status != $ ....}]
^
[Line: 1, Column: 1]
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (JBRULES-3053) Include jbpm-persistence-jpa.jar into distribution
by Tomáš Schlosser (JIRA)
Include jbpm-persistence-jpa.jar into distribution
--------------------------------------------------
Key: JBRULES-3053
URL: https://issues.jboss.org/browse/JBRULES-3053
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.2.0.M2
Reporter: Tomáš Schlosser
Assignee: Mark Proctor
If jbpm-persistence-jpa.jar is not on classpath, following exceptionis thrown:
Exception in thread "main" java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:130)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)
at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:109)
at org.sample.Test.main(Test.java:48)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)
... 3 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Unable to load class: org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory
at org.jbpm.process.instance.ProcessRuntimeImpl.loadClass(ProcessRuntimeImpl.java:97)
at org.jbpm.process.instance.ProcessRuntimeImpl.initProcessInstanceManager(ProcessRuntimeImpl.java:71)
at org.jbpm.process.instance.ProcessRuntimeImpl.<init>(ProcessRuntimeImpl.java:60)
at org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl.newProcessRuntime(ProcessRuntimeFactoryServiceImpl.java:10)
at org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl.newProcessRuntime(ProcessRuntimeFactoryServiceImpl.java:6)
at org.drools.runtime.process.ProcessRuntimeFactory.newProcessRuntime(ProcessRuntimeFactory.java:12)
at org.drools.common.AbstractWorkingMemory.createProcessRuntime(AbstractWorkingMemory.java:359)
at org.drools.common.AbstractWorkingMemory.setKnowledgeRuntime(AbstractWorkingMemory.java:1260)
at org.drools.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:116)
at org.drools.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:110)
at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:372)
at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:352)
at org.drools.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession(KnowledgeBaseImpl.java:175)
at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:101)
... 8 more
Caused by: java.lang.ClassNotFoundException: Unable to load class: org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory
at org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:92)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.jbpm.process.instance.ProcessRuntimeImpl.loadClass(ProcessRuntimeImpl.java:95)
... 21 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (JBRULES-3108) problems with concurrent process executions, constraints, and multiple sessions
by Jordi Alvarez (JIRA)
problems with concurrent process executions, constraints, and multiple sessions
-------------------------------------------------------------------------------
Key: JBRULES-3108
URL: https://issues.jboss.org/browse/JBRULES-3108
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (flow)
Affects Versions: 5.2.0.Final, 5.1.1.FINAL
Environment: Independent of OS, JVM, and Application Server. Reproduced in a windows development environment with a Sun JVM. Also reproduced in linux. Also database independent: reproduced with Oracle RDBMS and HSQLDB.
Reporter: Jordi Alvarez
Assignee: Mark Proctor
The context is as follows:
1. We have drools flow configured with JPA and Hibernate, accessing an Oracle / HSQLDB database (depending on the environment).
2. We do have several concurrent stateful sessions in which different instances of the same kind of processes are running. These stateful sessions are persisted in the same database schema.
3. We do use wait states (also reproduced with rule nodes) that have constraints that wait for a fact to be inserted into the stateful session.
4. Whenever the fact that makes the constraint to satisfy is inserted for one process in a given stateful session; if there are other processes waiting in that wait state/constraint (in other different stateful sessions), the stateful session tries also to continue those process executions, even when they are not part of it.
A solution has been implemented temporally over drools source code (in order to get our context working): the solution is briefly described in the forum url below. For completeness a summary is included here:
- Adding a new attribute to org.drools.persistence.processinstance.ProcessInstanceInfo POJO identifying the stateful session to which the process instance corresponds (and the corresponding DB column).
- modifying the ProcessInstancesWaitingForEvent query (in orm.xml) in order to take into account the session id as a (new) second parameter.
- modify the class org.drools.persistence.processinstance.JPASignalManager in order to execute the query with both parameters.
- as a quick way to have the session id, we have a threadlocal.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (JBRULES-3120) Error - no visitor implementation for : class org.jbpm.ruleflow.core.RuleFlowProcess
by shashi mhatre (JIRA)
Error - no visitor implementation for : class org.jbpm.ruleflow.core.RuleFlowProcess
------------------------------------------------------------------------------------
Key: JBRULES-3120
URL: https://issues.jboss.org/browse/JBRULES-3120
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (flow)
Affects Versions: 5.1.0.FINAL
Environment: Windows XP, Java 1.6.23
Reporter: shashi mhatre
Assignee: Mark Proctor
Drools KnowledgeAgent print below message on console after executing rules.
"no visitor implementation for : class org.jbpm.ruleflow.core.RuleFlowProcess : org.jbpm.ruleflow.core.RuleFlowProcess@5d5660fe"
This happens when "NewInstance" property of the knowledgeAgent is set to false.
I have configured one BPMN process and a simple DRL file in the changeset.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (JBRULES-3109) drools-flow: deadlock for concurrent process completions in oracle
by Jordi Alvarez (JIRA)
drools-flow: deadlock for concurrent process completions in oracle
------------------------------------------------------------------
Key: JBRULES-3109
URL: https://issues.jboss.org/browse/JBRULES-3109
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (flow)
Affects Versions: 5.1.1.FINAL
Environment: Use of Oracle RDBMS as the dabase system
Reporter: Jordi Alvarez
Assignee: Mark Proctor
Hello, we are using drools-flow with JPA, using Hibernate and Oracle RDBMS.
We do have multiple concurrent stateful sessions.
We also make extensive use of timers.
Additionally, we need a blocking system that guarantees that only one request is executing concurrently for a stateful session. We have checked that out bloquing system is working correctly. This blocking system takes into account timers also.
In this context, we have detected a situation in which deadlocks are produced when several process instances are tried to be deleted concurrently. The deleted process instances do not need to have anything in common.
The database sessions involved in the deadlock report always to be performed when they are executing:
DELETE FROM ProcessInstanceInfo
WHERE InstanceId = :1 AND OPTLOCK = :2
Which corresponds to the removal of a process.
Looking into database locks acquired by sessions it can be seen that the table over whichthe deadlock is produced is EVENTTYPES.
The problem is indeed caused when the cascade on delete is applied.
Whenever a ProcessInstanceInfo row is deleted, this produces to delete all EVENTTYPES records associated with that process instance.
Oracle locks the EVENTTYPES table with mode S/Row-X (SSX) . Additionally, it locks the deleted rows with mode Row-X (SX).
Whenever several ProcessInstanceInfo rows are deleted concurrently, there are several database sessions performing these locks concurrently, which is the cause of the deadlock.
A more generic description of the situation can be found in:
http://www.mail-archive.com/hibernate-devel@lists.sourceforge.net/msg0549...
As it is suggested in this link, the creation of an index over EVENTTYPES foreign key for ProcessInstanceInfo solves the problem.
The index we have created is a simple one over the foreign key, as follows:
CREATE INDEX IDX_EVENTTYPES ON EVENTTYPES (INSTANCEID);
It would be nice that the automatically created tables contains that index. Alternatively, the documentation should contain some addendum regarding the database tables created, in order to create the index manually, at least for the Oracle database.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (JBRULES-3190) NPE when updating fact
by Tomáš Schlosser (JIRA)
NPE when updating fact
----------------------
Key: JBRULES-3190
URL: https://issues.jboss.org/browse/JBRULES-3190
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.3.0.Beta1
Reporter: Tomáš Schlosser
Assignee: Mark Proctor
Take the example project from JBRULES-2887 and run it. You'll get this exception:
Exceuting
ruleorg.drools.runtime.rule.ConsequenceException: rule: MESSAGE_HELLO
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1093)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1022)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1243)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at com.sample.DroolsTest.main(DroolsTest.java:41)
Caused by: java.lang.NullPointerException
at org.drools.reteoo.ReteooWorkingMemory$EvaluateResultConstraints.execute(ReteooWorkingMemory.java:576)
at org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextImpl.java:265)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:465)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:365)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:294)
at com.sample.Rule_MESSAGE_HELLO_0.defaultConsequence(Rule_MESSAGE_HELLO_0.java:8)
at com.sample.Rule_MESSAGE_HELLO_0DefaultConsequenceInvoker.evaluate(Rule_MESSAGE_HELLO_0DefaultConsequenceInvoker.java:27)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1083)
... 6 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month