Red Hat Bugzilla – Bug 1310039
Kie-Aries-Blueprint fails to create a KieBase importing classes from another bundle
Last modified: 2016-03-30 08:47:14 EDT
Created attachment 1128499 [details]
Description of problem:
When using kie-aries-blueprint for defining a KieSession/KieBase, it fails to compile DRL which imports a class installed in Fuse/Karaf as another bundle.
The bundle with Blueprint container imports the class' package correctly, while the bundle containing the class exports it.
Example use case for this behaviour is when you create a bundle containing domain classes which are used in DRL and by the bundle defining application logic (for inserting facts into the KieSession, for instance).
The same use-case works in OSGi when using kie-spring. My guess would be not passing the correct classloader to the KieContainer created by kie-aries-blueprint.
Please see the reproducer for details.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. see the PR with reproducer - run KieBlueprintDependencyKarafIntegrationTest
The following exception is thrown when creating the KieBase:
Caused by: java.lang.RuntimeException: Error while creating KieBase[Message [id=1, level=ERROR, path=drl_kiesample_dependency/Hal1.drl, line=10, column=0
text=Unable to resolve ObjectType 'Assert'], Message [id=2, level=ERROR, path=drl_kiesample_dependency/Hal1.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=3, level=ERROR, path=drl_kiesample_dependency/Hal1.drl, line=1, column=0
text=Error importing : 'org.junit.Assert']]
The KieBase can be compiled without issues.
PR with reproducer: https://github.com/droolsjbpm/droolsjbpm-integration/pull/315
Fixed by https://github.com/droolsjbpm/droolsjbpm-integration/commit/c34ee1e94d553fdeaf749125dd4b8219bccbb2b4
Verified in BRMS 6.3.0 ER2.