Red Hat Bugzilla – Bug 1312285
OSGi: Drools/jBPM engine fails to build a BPMN2 process that uses domain classes
Last modified: 2016-04-18 09:07:03 EDT
Created attachment 1130812 [details]
Description of problem:
Drools/jBPM engine fails to create the KieBase for BPMN process which references classes from domain jars installed as another bundle in OSGi container.
The error message "Unable to generate action invoker. org.jbpm.process.instance.impl.Action cannot be resolved to a type" indicates that there might be a missing Import-Package header. Indeed, when I enabled dynamic import (dev:dynamic-import <BUNDLE_ID>) on drools-compiler and drools-core bundles, the process was compiled successfully.
This bug is similar to BZ 1310039, with the following differences:
- the issue happens not only in Blueprint, but also when you create the KieContainer with proper class loader,
- there is the workaround (enabling dynamic imports in drools-core and drools-compiler bundles).
The problem will very likely be fixed in Drools, so I reported it here instead of jBPM - feel free to reassign.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. see the PR with reproducer - run KieBlueprintProcessDependencyKarafIntegrationTest
2. please be aware that to make the reproducer test pass completely, BZ 1310039 needs to be fixed too.
java.lang.RuntimeException: Error while creating KieBase[Message [id=1, level=ERROR, path=blueprint_process_dep/sampleProcess.bpmn2, line=-1, column=0
text=Unable to generate action invoker. org.jbpm.process.instance.impl.Action cannot be resolved to a type], Message [id=2, level=ERROR, path=blueprint_process_dep/sampleRule.drl, line=11, column=0
text=Unable to resolve ObjectType 'Assert'], Message [id=3, level=ERROR, path=blueprint_process_dep/sampleRule.drl, line=7, column=0
text=Rule Compilation error Only a type can be imported. org.junit.Assert resolves to a package
assertInstance cannot be resolved to a variable], Message [id=4, level=ERROR, path=blueprint_process_dep/sampleRule.drl, line=1, column=0
text=Error importing : 'org.junit.Assert']]
KieBase is built without errors.
Created attachment 1139956 [details]
Exception stacktrace after BZ 1310039 fix
Added updated stacktrace.
Fixed by https://github.com/droolsjbpm/drools/commit/cc5a0b4ab
Ryan, it seems that the commit with the fix has not made it into ER2, could you please double check?
It seems present on 6.4.x branch , while it seems not present in sync-6.4.x-2016.03.24 tag.
The missing commit is present in ER3, waiting for test results for final verification.
Verified in BRMS 6.3.0 ER3.