Bug 1310039 - Kie-Aries-Blueprint fails to create a KieBase importing classes from another bundle
Kie-Aries-Blueprint fails to create a KieBase importing classes from another ...
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Fuse Integration (Show other bugs)
Unspecified Unspecified
urgent Severity high
: ER2
: 6.3.0
Assigned To: Mario Fusco
Marek Winkler
Petr Penicka
Depends On:
Blocks: 1310714
  Show dependency treegraph
Reported: 2016-02-19 05:08 EST by Marek Winkler
Modified: 2016-03-30 08:47 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1310714 (view as bug list)
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Exception stacktrace (7.26 KB, text/plain)
2016-02-19 05:08 EST, Marek Winkler
no flags Details

  None (edit)
Description Marek Winkler 2016-02-19 05:08:27 EST
Created attachment 1128499 [details]
Exception stacktrace

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):
BRMS 6.2.1
Fuse 6.2.1

How reproducible:

Steps to Reproduce:
1. see the PR with reproducer - run KieBlueprintDependencyKarafIntegrationTest

Actual results:
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']]
        at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:447)
        at org.kie.aries.blueprint.factorybeans.KieObjectsResolver.resolveKBase(KieObjectsResolver.java:38)

Expected results:
The KieBase can be compiled without issues.
Comment 1 Marek Winkler 2016-02-19 05:11:32 EST
PR with reproducer: https://github.com/droolsjbpm/droolsjbpm-integration/pull/315
Comment 6 Marek Winkler 2016-03-30 08:47:14 EDT
Verified in BRMS 6.3.0 ER2.

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