[JBoss JIRA] Created: (JBRULES-2547) NullPointerException in ObjectFactory$ObjectEqualEvaluator in 4.0.7
by Eduardo Oré (JIRA)
NullPointerException in ObjectFactory$ObjectEqualEvaluator in 4.0.7
-------------------------------------------------------------------
Key: JBRULES-2547
URL: https://jira.jboss.org/browse/JBRULES-2547
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.7
Reporter: Eduardo Oré
Assignee: Mark Proctor
I have a NullPointerException in ObjectEqualEvaluator.evaluate() when trying to make a retract.
Caused by: java.lang.NullPointerException
at org.drools.base.com.amadeus.jcp.standard.business.ruleservice.policyapplication.facts.hotel.PreferredRoom22074433$getRoom.getValue(Unknown Source)
at org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:127)
at org.drools.base.evaluators.ObjectFactory$ObjectEqualEvaluator.evaluate(ObjectFactory.java:130)
at org.drools.util.AbstractHashTable$DoubleCompositeIndex.equal(AbstractHashTable.java:669)
at org.drools.util.FactHandleIndexHashTable$FieldIndexEntry.matches(FactHandleIndexHashTable.java:379)
at org.drools.util.FactHandleIndexHashTable.remove(FactHandleIndexHashTable.java:200)
at org.drools.reteoo.JoinNode.retractObject(JoinNode.java:180)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateRetractObject(CompositeObjectSinkAdapter.java:375)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:189)
at org.drools.reteoo.Rete.retractObject(Rete.java:215)
at org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:211)
at org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:79)
at org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1023)
at org.drools.base.DefaultKnowledgeHelper.retract(DefaultKnowledgeHelper.java:122)
at com.amadeus.act.hotel.Rule_Company_policy__preferred_Room_without_rate_code_policies_0.consequence(Rule_Company_policy__preferred_Room_without_rate_code_policies_0.java:18)
at com.amadeus.act.hotel.Rule_Company_policy__preferred_Room_without_rate_code_policies_0ConsequenceInvoker.evaluate(Rule_Company_policy__preferred_Room_without_rate_code_policies_0ConsequenceInvoker.java:25)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2493) Drools does not make use of the PropertyChangeListeners on my objects
by Tamas Cserveny (JIRA)
Drools does not make use of the PropertyChangeListeners on my objects
---------------------------------------------------------------------
Key: JBRULES-2493
URL: https://jira.jboss.org/jira/browse/JBRULES-2493
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.0.1.FINAL
Environment: Eclipse RCP
Reporter: Tamas Cserveny
Assignee: Mark Proctor
Hi,
I've asserted an object with the relevant add and remove methods for the change support, but drools did not subscribe to property changes.
I've used StatefulKnowledgeSession's insert method for this.
After some minutes it turned out, that the insert method delegates the call to the ReteooWorkingMemory with dynamic property set to false.
It might be that this is the reason why they were not picked up.
Cheers,
Tamas
--
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
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2484) Unsupported brackets in right operator
by Jeremy Ary (JIRA)
Unsupported brackets in right operator
--------------------------------------
Key: JBRULES-2484
URL: https://jira.jboss.org/jira/browse/JBRULES-2484
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.1.0.M1, 5.0.1.FINAL
Reporter: Jeremy Ary
Assignee: Mark Proctor
Class QueueList has two properties:
private QueueIds idList; //QueueIds just extends HashMap<String, Integer>
private Collection<Integer> queueIds;
rule "testing"
when
QueueList ( queueIds contains idList["ABC"] )
then
System.out.println("testing fired");
end
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1938)
at org.drools.rule.builder.PatternBuilder.buildRestriction(PatternBuilder.java:888)
at org.drools.rule.builder.PatternBuilder.buildRestriction(PatternBuilder.java:717)
at org.drools.rule.builder.PatternBuilder.createRestriction(PatternBuilder.java:504)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:351)
at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:239)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:196)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:104)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:68)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at com.sample.DroolsTest.createKnowledgeBase(DroolsTest.java:47)
at com.sample.DroolsTest.main(DroolsTest.java:19)
--
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
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2332) Drools JPA- Spring Transactions
by Pradeep Thomas (JIRA)
Drools JPA- Spring Transactions
-------------------------------
Key: JBRULES-2332
URL: https://jira.jboss.org/jira/browse/JBRULES-2332
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.0.1.FINAL
Environment: Java (1.6)
Spring framework (2.5.6)
Hibernate (3.3.2.GA)
Drools (5.0.1) Using Expert and Flow parts.
Oracle (11g)
Reporter: Pradeep Thomas
Assignee: Mark Proctor
What we do
We have a domain model. It is made up of a number of objects annotated with JPA annotations (for persistence) with Hibernate as the ORM provider.
The drools JPA persistence module is also made of java classes annotated for persistence.
We're trying to create a stateful session and start a process. Process stops in a waiting state at some point. Then we want to persist the session together with the process state. Application needs to be able to load the session back into memory and continue with the process execution (by sending notify events).
Issues
First issue
The first issue we faced was that the drools persistence module does not work out of box for Oracle.
Cause: Table/column names too long,
Fix: This was sorted by overrides to the annotations in the drools-jpa source code.
Current issue
The issues that we are currently facing are related to transactions/JPA entity manager and persisting of Session/Process/Workitem etc.
The expected transactional/persistence behaviour is
------- Begin Transaction (triggered by Spring's transactional annotation that also creates the entity manager)
1) Persist/Read domain entities from datasource
2) Persist/Read drools entities from same datasource
-------End Transaction (commit/rollback releases the entity manager)
The expected behaviour is without the use of a distributed transaction manager (because we have a single datasource and no distributed transactions)
It seems like the persistence module out of the box in drools-jpa relies on a Distributed transaction manager (DTM) and in the absence of one (configured by us) uses Bitronix (an built-in DTM)
The use of Bitronix further complicates matters as its not related to the transaction/entity manager created by Spring and visibility of domain entities/drools entities have of each other.
The way we would like to use drools persistence is:
a) Entities (drools/domain) to be managed by the same entity manager (persisted/read) for both Domain model entities and Drools JPA entities.
b) Participate in the same (RESOURCE_LOCAL) transaction (committed/rolled back)
c) Eliminate the need for a DTM if there is a single datasource
Question : is there anything we're doing is incorrect or is the described behaviour not available in the current version?
Any advice would be appreciated.
--
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
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2316) StringIndexOutOfBoundsException when a fact is in default package
by Renaud Julienne (JIRA)
StringIndexOutOfBoundsException when a fact is in default package
-----------------------------------------------------------------
Key: JBRULES-2316
URL: https://jira.jboss.org/jira/browse/JBRULES-2316
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 4.0.7
Reporter: Renaud Julienne
Assignee: Mark Proctor
Assuming you have a rule base for which you have defined shadow proxy excludes.
If you insert a fact which class is in default package, a StringIndexOutOfBoundsException is raised by RuleBaseConfiguration#isShadowed()
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at org.drools.RuleBaseConfiguration.isShadowed(RuleBaseConfiguration.java:546)
at org.drools.reteoo.Rete$ClassObjectTypeConf.defineShadowProxyData(Rete.java:486)
at org.drools.reteoo.Rete$ClassObjectTypeConf.<init>(Rete.java:468)
at org.drools.reteoo.Rete.assertObject(Rete.java:152)
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:704)
..........
Problem comes from this line (RuleBaseConfiguration.java:546):
String qualifiedNamespace = className.substring( 0,
className.lastIndexOf( '.' ) ).trim(); // => default package => no '.' => exception
This can typically happen when trying to insert JDKProxies into the working memory for test purpose (EasyMock use such proxies).
The issue only appears if you have defined shadow proxy excludes.
--
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
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2315) DroolsMVELFactory leaks memory in previousDeclarationsObjectCache field using "from" DRL construct
by Kurt Westerfeld (JIRA)
DroolsMVELFactory leaks memory in previousDeclarationsObjectCache field using "from" DRL construct
--------------------------------------------------------------------------------------------------
Key: JBRULES-2315
URL: https://jira.jboss.org/jira/browse/JBRULES-2315
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.0.1.FINAL
Environment: Windows/any
Reporter: Kurt Westerfeld
Assignee: Mark Proctor
When using the DRL construct to extract variables using a "from" clause, a FromNode is created which extracts data using an instance of DroolsMVELFactory paired with MVELDataProvider. After processing of rule agenda items, many of these nodes can exist and hold onto memory due to the snapshot of data processed during DroolsMVELFactory.setContext(), called from MVELDataProvider.getResults(). The snapshotting of state is held in (HashMap) previousDeclarationsObjectCache of DroolsMVELFactory.
Suggest that during MVELDataProvider.getResults() call clear on the DroolsMVELFactory after obtaining the results. The clear method could clear out previousDeclarationsObjectCache, which is used during the processing of the MVEL expression.
In my application, much data held from these nodes kept instances of data in memory, even though the data was never asserted into working memory.
--
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
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2226) Creating custom ConsequenceExceptionHandler with application restart
by Uros Majeric (JIRA)
Creating custom ConsequenceExceptionHandler with application restart
--------------------------------------------------------------------
Key: JBRULES-2226
URL: https://jira.jboss.org/jira/browse/JBRULES-2226
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-api
Affects Versions: 5.0.1.FINAL
Environment: JBoss AS 5.1
Drools 5.0.1
JBoss ESB 4.6
Reporter: Uros Majeric
Assignee: Mark Proctor
I have a JBoss ESB and in it I have created my custom ConsequenceExceptionHandler. When I deploy the esb everything is ok. When I redeploy the application, deployment goes fine. But when my application get an error (exception), my custom exception handler should catch the exception (in method handleException(Activation activation, WorkingMemory workingMemory, Exception exception)), but instead of catching the exception get an error:
java.lang.RuntimeException: Unable to instantiate object for class 'si.aditus.drools.CustomConsequenceExceptionHandler'
My custom Exception Handler:
public class CustomConsequenceExceptionHandler implements ConsequenceExceptionHandler {
public void handleException(Activation activation, WorkingMemory workingMemory, Exception exception) {
if (!(exception instanceof MyException || exception instanceof OtherException)) {
System.err.println(exception.getClass());
exception.printStackTrace();
return;
}
System.out.println("exceptions: "+exception);
}
}
Knowledge Base instantiation:
KnowledgeBaseConfiguration kbc = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
((RuleBaseConfiguration)kbc).setConsequenceExceptionHandler(CustomConsequenceExceptionHandler.class.getName());
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbc);
--
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
13 years, 8 months