Bug 1005165 - CCE when using negative patterns without turning on STREAM mode
Summary: CCE when using negative patterns without turning on STREAM mode
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ER4
: 6.0.0
Assignee: Mario Fusco
QA Contact: Tomas David
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-06 10:43 UTC by Marek Winkler
Modified: 2014-08-06 20:19 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:19:26 UTC
Type: Bug


Attachments (Terms of Use)

Description Marek Winkler 2013-09-06 10:43:44 UTC
Description of problem:

A ClassCastException comes up when using negative patterns without setting event processing mode to STREAM.

This configuration does not really make sense, but a warning or an error indicating what the real problem is should be emitted, instead of a general CCE.

The exception stacktrace:

java.lang.ClassCastException: org.drools.core.reteoo.RuleTerminalNodeLeftTuple cannot be cast to org.drools.core.time.impl.DefaultJobHandle
	at org.drools.core.phreak.PhreakTimerNode.doLeftDeletes(PhreakTimerNode.java:154)
	at org.drools.core.phreak.PhreakTimerNode.doNode(PhreakTimerNode.java:59)
	at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:360)
	at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:162)
	at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:117)
	at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:205)
	at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:65)
	at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:936)
	at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1183)
	at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:936)
	at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:910)
	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:233)
	at org.drools.compiler.integrationtests.NegativePatternsTest.testSingleEvent(NegativePatternsTest.java:140)


Version-Release number of selected component (if applicable):

Drools 6.0.0-SNAPSHOT
BRMS 6.0.0-ER2

How reproducible:

Remove line 98: .setEventProcessingMode(EventProcessingOption.STREAM); in the org.drools.compiler.integrationtests.NegativePatternsTest class and run tests from this class.

Comment 1 Mario Fusco 2013-09-13 18:30:22 UTC
It is not possible to raise a compilation error in this case because the EventProcessingMode is a KieBase option and then it is not available at compile time.

What I did is to throw a RuntimeException when you try to create such a kieBase saying:

java.lang.RuntimeException: The requested KieBase "KBase" has been set to run in CLOUD mode but requires features only available in STREAM mode

I added a test case demonstrating this here:

https://github.com/droolsjbpm/drools/blob/69dd8626bb40cd86dd59247a908aa8f212b5eb84/drools-compiler/src/test/java/org/drools/compiler/integrationtests/CepEspTest.java#L3210

Comment 5 Tomas David 2013-10-14 10:08:28 UTC
Verified on BRMS 6.0.0.ER4.


Note You need to log in before you can comment on or make changes to this bug.