-
1. Problem installation jbpm5 with spring beans
salaboy21 Feb 10, 2011 8:54 AM (in response to pavel.sknar)Did you try with the latest snapshots? Sounds like an old issue. But it's fixed in the latest version.
Can provide the Drools and jBPM version that you are using?
Greetings
-
2. Problem installation jbpm5 with spring beans
pavel.sknar Feb 10, 2011 11:32 AM (in response to salaboy21)I get latest drools-spring sources from git: last revision number 9f22d34c5db499c51cd69b460143d84a5b0ef3c2 at 03.02.11 19:47.
Version drools libs is from jbpm binary release (5.2.0.M1).
-
3. Re: Problem installation jbpm5 with spring beans
mmjose26 Feb 15, 2011 9:21 PM (in response to pavel.sknar)I have the same problem with simple test case using Spring + drools +guvrnor.
debugging the spring-drools jar, I found that KnowledgeSessionDefinitionParser is the problem.
Here the code:
....
......
// find any kagent's for the current kbase and assign
for ( String beanName : parserContext.getRegistry().getBeanDefinitionNames() ) {
BeanDefinition def = parserContext.getRegistry().getBeanDefinition(beanName);
if ( def.getBeanClassName().equals( KnowledgeAgentBeanFactory.class.getName() ) ) {
PropertyValue pvalue = def.getPropertyValues().getPropertyValue( "kbase" );
RuntimeBeanReference tbf = ( RuntimeBeanReference ) pvalue.getValue();
if ( kbase.equals( tbf.getBeanName() ) ) {
factory.addPropertyValue( "knowledgeAgent", new RuntimeBeanReference( beanName ) );
}
}
}
return factory.getBeanDefinition();
}
it fails when ksession is stateful, because StatefulKnowledgeSessionBeanFactory don't have the property knowledgeAgent
I don't understand the propose of this part of code.
if you change the order definition from xml and define ksession at top, "it works" because how spring container load the beans, and is the reason of in the test cases of drools all works fine.
I tink that is a bug, maybe we need more docs and about spring-drools api.
Greetings