This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1293455 - [GSS] (6.2.z) kie-ci-osgi Activator doesn't register the ClassLoaderResolver on the ServiceRegistry
[GSS] (6.2.z) kie-ci-osgi Activator doesn't register the ClassLoaderResolver ...
Status: VERIFIED
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Fuse Integration (Show other bugs)
6.1.0
All All
high Severity high
: CR1
: 6.2.1
Assigned To: Mario Fusco
Marek Winkler
Petr Penicka
:
Depends On:
Blocks: 1288021 1288023 1293965
  Show dependency treegraph
 
Reported: 2015-12-21 14:10 EST by Matthew Robson
Modified: 2016-01-19 07:30 EST (History)
4 users (show)

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


Attachments (Terms of Use)
reproducer (98.03 KB, application/zip)
2015-12-21 14:10 EST, Matthew Robson
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker DROOLS-1012 Major Closed kie-ci-osgi Activator doesn't register the ClassLoaderResolver on the ServiceRegistry 2017-01-05 15:49 EST

  None (edit)
Description Matthew Robson 2015-12-21 14:10:02 EST
Created attachment 1108448 [details]
reproducer

Description of problem:

The issue is that when the kjar is first loaded or reloaded from a scan, it does not get correctly built because the compiler has no viability to the model objects which reside in a different bundle.  This is true even though the correct OSGI level imports and exports are defined.

12:25:16,800 | ERROR | l Console Thread | AbstractKieModule                | 441 - org.drools.compiler - 6.2.0.201510160042 | Unable to build KieBaseModel:test-kbase
Unable to resolve ObjectType 'MyModelObj' : [Rule name='Your First Rule']

Error importing : 'com.redhat.drools.camel.model.MyModelObj'
Error importing : 'com.redhat.drools.camel.model.MyOtherModelObj'

If I update the KJAR and rebuild, when the scanner picks it up, there is always an unable to build ERROR importing the model objects.

11:41:14,862 | INFO  | Timer-2          | KieRepositoryImpl                | 676 - org.drools.compiler - 6.2.0.201510160042 | KieModule was added: ZipKieModule[releaseId=com.redhat:test-kjar:0.0.1-SNAPSHOT,file=/home/mrobson/.m2/repository/com/redhat/test-kjar/0.0.1-SNAPSHOT/test-kjar-0.0.1-SNAPSHOT.jar]                                                                                                                                                                       
11:41:15,544 | INFO  | Timer-2          | KieScanner                       | 678 - org.kie.scanner.osgi - 6.2.0.201510160042 | The following artifacts have been updated: {com.redhat:test-kjar:0.0.1-SNAPSHOT=com.redhat:test-kjar:jar:0.0.1-SNAPSHOT}
11:41:18,022 | ERROR | Timer-3          | AbstractKieModule                | 676 - org.drools.compiler - 6.2.0.201510160042 | Unable to build KieBaseModel:test-kbase                                                                       
Unable to resolve ObjectType 'MyModelObj' : [Rule name='Your First Rule']                                                                                                                                                                   
                                                                                                                                                                                                                                            
Error importing : 'com.redhat.drools.camel.model.MyModelObj'                                                                                                                                                                                
Error importing : 'com.redhat.drools.camel.model.MyOtherModelObj'                                                                                                                                                                           
                                                                                                                                                                                                                                            
11:41:18,022 | INFO  | Timer-3          | KieScanner                       | 678 - org.kie.scanner.osgi - 6.2.0.201510160042 | The following artifacts have been updated: {com.redhat:test-kjar:0.0.1-SNAPSHOT=com.redhat:test-kjar:jar:0.0.1-SNAPSHOT}
Version-Release number of selected component (if applicable):


How reproducible:

100%

Steps to Reproduce:

Attached is the reproducer.

To deploy:

mvn clean install

From Fuse:

features:addurl mvn:com.redhat/brms-fuse-integration-features/0.0.1-SNAPSHOT/xml/features

features:install brms-integration-bundle

You will see:

[ 747] [Active     ] [            ] [       ] [   60] KIE API (6.2.0.201510160031)
[ 748] [Active     ] [            ] [       ] [   60] KIE Internal (6.2.0.201510160031)
[ 749] [Active     ] [            ] [       ] [   60] Drools :: Core (6.2.0.201510160042)
[ 750] [Active     ] [            ] [       ] [   60] Drools :: Compiler (6.2.0.201510160042), Fragments: 751
[ 751] [Resolved   ] [            ] [       ] [   60] Drools :: OSGi Integration (6.2.0.201510160116), Hosts: 750
[ 752] [Active     ] [            ] [       ] [   60] KIE :: CI for OSGi (6.2.0.201510160042)
[ 753] [Active     ] [            ] [       ] [   80] brms-fuse-model (0.0.1.SNAPSHOT)
[ 754] [Active     ] [Created     ] [       ] [   90] brms-service (0.0.1.SNAPSHOT)

When it deploys, you will see the rule fire:

JBossFuse:karaf@root> features:install brms-integration-bundle 
Running rules from bundle startup
Release ID = com.redhat:test-kjar:0.0.1-SNAPSHOT
kContainer = org.drools.compiler.kie.builder.impl.KieContainerImpl@1a9e5343
kScanner = org.kie.scanner.KieRepositoryScannerImpl@eaaec9a
Session info org.drools.core.impl.StatefulKnowledgeSessionImpl@2fc86fb6
The rule has run, great success!

And in the logs:

08:39:20,116 | INFO  | l Console Thread | KieRepositoryImpl                | 768 - org.drools.compiler - 6.2.0.201510160042 | KieModule was added: ZipKieModule[releaseId=com.redhat:test-kjar:0.0.1-SNAPSHOT,file=/home/mrobson/.m2/repository/com/redhat/test-kjar/0.0.1-SNAPSHOT/test-kjar-0.0.1-SNAPSHOT.jar]

To re-create the issue, disable the Bundle-Activator:

vi brms-service/pom.xml

Comment out:
<Bundle-Activator>com.redhat.drools.camel.api.impl.DroolsBRMSRulesService</Bundle-Activator>

Rebuild and redeploy.

You will see:

08:44:23,624 | ERROR | l Console Thread | AbstractKieModule                | 262 - org.drools.compiler - 6.2.0.201510160042 | Unable to build KieBaseModel:test-kbase
Unable to resolve ObjectType 'MyModelObj' : [Rule name='Your First Rule']

Error importing : 'com.redhat.drools.camel.model.MyModelObj'
Error importing : 'com.redhat.drools.camel.model.MyOtherModelObj'


Actual results:
Error importing : 'com.redhat.drools.camel.model.MyModelObj'
Error importing : 'com.redhat.drools.camel.model.MyOtherModelObj'

Expected results:
Successfully compile the KJAR

Additional info:
Comment 2 Matthew Robson 2015-12-21 14:11:12 EST
Fixed via https://github.com/droolsjbpm/drools/commit/e48ee1730
Comment 7 Mario Fusco 2016-01-04 12:40:01 EST
Cherry-picked to 6.3.x branch with https://github.com/droolsjbpm/drools/commit/f4dc763f8
Comment 8 Marek Winkler 2016-01-19 07:30:42 EST
Verified in BRMS 6.2.1 CR1 with Fuse 6.2.1 and 6.2.0.

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