Bug 1005165 - CCE when using negative patterns without turning on STREAM mode
CCE when using negative patterns without turning on STREAM mode
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.0.0
Unspecified Unspecified
unspecified Severity low
: ER4
: 6.0.0
Assigned To: Mario Fusco
Tomas David
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-06 06:43 EDT by Marek Winkler
Modified: 2014-08-06 16:19 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:19:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marek Winkler 2013-09-06 06:43:44 EDT
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 14:30:22 EDT
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 06:08:28 EDT
Verified on BRMS 6.0.0.ER4.

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