I am trying to create a web application (spring -mvc) with kie (drools 6) integrated by injection. I used the workplace to create a workflow, completed and deployed. I added a link to this artifact in my pom.xml project and added a local kie-workbench repository according to this blog post and it works fine (pulling an artifact depending on my maven / spring project). What I'm trying to do is inject kiesession into one of my services as a dependency with the following snippet -
@Service public class TniServiceImpl implements TniService { @Inject @KSession("tniSession") private KieSession tniSession; ... }
In my root .xml context, I added the kie namespace as well as the xsd link. I added org.kie.spring.KModuleBeanFactoryPostProcessor, as well as roll documentation. I am trying to do a CDI injection job for scanning and KSession injection (it already works for my other components in the same project using @Inject). Until now, I always get a “No qualification bean of type [org.kie.api.runtime.KieSession] found for the“ error ”dependency. It looks like spring cannot scan for available modules and sessions in it. I need help with the following -
- Is CDI injection really supported with spring? Should I automatically configure kmodules and kession as indicated here ?
- I missed something here, what should this scan and injection operation do?
My next environment is
- spring 3.2.6-RELEASE (including webmvc and other components)
- kie-api-6.0.1.FINAL
- kie- spring -6.0.1.FINAL
- kie-internal-6.0.1.FINAL
I already went through the links, but no luck (basically they are not trying to do what I am) -
- Download Drools / KIE Workbench artifacts directly from the repository
- Why does loading Drools 6 KIE JAR into code not work?
I would appreciate it if someone could direct me to what might be missing here, or if there is no option but to explicitly define all the module files / ksessions in the spring configuration file.
spring drools jbpm kie
Avnish
source share