Bug 761421 - working memory event listener not registered from Spring configuration
Summary: working memory event listener not registered from Spring configuration
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: Nobody
QA Contact: Radovan Synek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-08 10:08 UTC by Radovan Synek
Modified: 2022-11-15 23:14 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---


Attachments (Terms of Use)
maven web app (11.99 KB, application/zip)
2011-12-08 10:08 UTC, Radovan Synek
no flags Details

Description Radovan Synek 2011-12-08 10:08:54 UTC
Created attachment 542456 [details]
maven web app

I have folowing Spring configuration (showing only relevant part):

<bean id="debug-wm-listener" class="org.drools.event.DebugWorkingMemoryEventListener" />       
<drools:ksession id="statefulSession" type="stateful" kbase="kbase1"> 
    <drools:workingMemoryEventListener ref="debug-wm-listener"/>
</drools:ksession>

Configured WM Event listener in knowledge stateful session by Spring. Expecting (at least) one WM Event listener:
statefulSession.getWorkingMemoryEventListeners().size()

but size is 0. 

See attachment:
build as maven project, then deploy to tomcat, open webapp in browser and click on the second link.

Comment 1 Geoffrey De Smet 2012-01-10 18:06:09 UTC
On first sight, looks like KnowledgeSessionDefinitionParser is forgetting to call AbstractKnowledgeSessionBeanFactory.setWorkingMemoryEventListeners(...)

Comment 2 Geoffrey De Smet 2012-01-12 11:34:30 UTC
The problem is that the wrong DebugWorkingMemoryEventListener has been used.
Instead of:
    <bean id="debugWorkingMemoryEventListener" class="org.drools.event.DebugWorkingMemoryEventListener" />
it should be:
    <bean id="debugWorkingMemoryEventListener" class="org.drools.event.rule.DebugWorkingMemoryEventListener" />

I 'll adjust the code so it fails-fast when such wrong configuration happens.


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