Bug 1310039 - Kie-Aries-Blueprint fails to create a KieBase importing classes from another bundle
Summary: Kie-Aries-Blueprint fails to create a KieBase importing classes from another ...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Fuse Integration
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ER2
: 6.3.0
Assignee: Mario Fusco
QA Contact: Marek Winkler
Petr Penicka
URL:
Whiteboard:
Depends On:
Blocks: 1310714
TreeView+ depends on / blocked
 
Reported: 2016-02-19 10:08 UTC by Marek Winkler
Modified: 2020-03-27 20:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1310714 (view as bug list)
Environment:
Last Closed: 2020-03-27 20:11:01 UTC
Type: Bug
Embargoed:


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

Description Marek Winkler 2016-02-19 10:08:27 UTC
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:
always

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 10:11:32 UTC
PR with reproducer: https://github.com/droolsjbpm/droolsjbpm-integration/pull/315

Comment 6 Marek Winkler 2016-03-30 12:47:14 UTC
Verified in BRMS 6.3.0 ER2.


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