Bug 1312164
Summary: | drools-workbench-models-guided-dtable missing from drools-karaf-features and not OSGi packaged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] JBoss BRMS Platform 6 | Reporter: | Duane Hawkins <dhawkins> | ||||||
Component: | Fuse Integration | Assignee: | Edson Tirelli <etirelli> | ||||||
Status: | CLOSED EOL | QA Contact: | Jiri Petrlik <jpetrlik> | ||||||
Severity: | high | Docs Contact: | Klara Bezdekova <kkufova> | ||||||
Priority: | urgent | ||||||||
Version: | 6.3.0 | CC: | dhawkins, etirelli, kkufova, rrajasek | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: |
The drools-karaf-features XML contains a currently nonfunctional drools-workbench-models feature. In OSGi environment, using kJARs containing Guided Decision Tables (created in Business Central) results in the ClassNotFoundException error. There is currently no workaround.
|
Story Points: | --- | ||||||
Clone Of: | |||||||||
: | 1324527 (view as bug list) | Environment: | |||||||
Last Closed: | 2020-03-27 20:06:31 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 1324527 | ||||||||
Attachments: |
|
Is there any status on this one? Hi guys, Is there any status update for this issue? I have been looking into this and it will require more changes than expected. Since we would like to support all the WB models (except probably test scenarios), we will need to OSGify few more modules like drools-scorecards, drools-pmml and maybe others. This will require additional work as for example the drools-pmml is not quite ready for OSGi (code wise, not just about missing metadata). @Duane, what it the expected time frame for the fix? Do we need it for BxMS 6.3.0 GA? @Petr I do have a customer waiting on it. The only thing is, I haven't found a suitable workaround for it. What time frames are we looking at? @Petr Let me reach out and see if this is a show-stopper or if there is time before this is needed. @Petr - I asked the customer for clarification, to make sure, but I believe the customer is specifically looking for dtable support, as that is what he specifically mentioned. @Petr - customer confirms. The other models can be deferred. It seems we need the blocker flag in order to get this one into 6.3.0.GA. I don't have a permission to do so, could someone else do that? OSGi support for guided-dtables added to master and 6.4.x branches. 6.4.x: https://github.com/droolsjbpm/droolsjbpm-knowledge/commit/612192c6daf1 https://github.com/droolsjbpm/drools/commit/9e5ca80ae7a4a https://github.com/droolsjbpm/droolsjbpm-integration/commit/aa790190e50e62 master: https://github.com/droolsjbpm/droolsjbpm-knowledge/commit/6dd0a37ae1d7fa https://github.com/droolsjbpm/drools/commit/f8849faff327f91c20 https://github.com/droolsjbpm/droolsjbpm-integration/commit/d282c1434c7e8a4ab It is still not possible to use "drools-workbench-models-guided-dtable" in OSGI environment, because class "org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52" is not visible for xstream. The reproducer for this bug was unable to initialize KieContainer and failed with exception: "com.thoughtworks.xstream.mapper.CannotResolveClassException: org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52". I have both good and bad news! First the good: I found a workaround (at least for the attached reproducer, but should generally work for other use cases as well). The bundle needs to import the guided-dtable packages itself and then the code needs to set the TCCL (ThreadContextClassLoader). Following package need to be imported: org.drools.workbench.models.guided.dtable;version="[6.0,7)", org.drools.workbench.models.guided.dtable.backend;version="[6.0,7)", org.drools.workbench.models.guided.dtable.shared.model;version="[6.0,7)", org.drools.workbench.models.datamodel.rule;version="[6.0,7)", org.drools.workbench.models.guided.dtable.shared.auditlog;version="[6.0,7)", And then in the Bundle activator class, TCCL needs to be set like this: Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); The bad news is that this issue does not only affects external kjars, but also local resources (e.g. when the guided-dtable is packaged directly in the bundle). We still need to properly fix this, but it should not block the release I think (as there is a workaround). I will also attach improved reproducer with the workaround applied. Created attachment 1152967 [details]
Simpliefied reproducer with TCCL workaround applied.
Follow the top-level README file to run the reproducer.
Fix applied to both master and 6.4.x branches: master: https://github.com/droolsjbpm/drools/commit/bd6619de02631f843 https://github.com/droolsjbpm/droolsjbpm-integration/commit/ccd200e342e5ec6b93 6.4.x: https://github.com/droolsjbpm/drools/commit/2011a8da10000ff0 https://github.com/droolsjbpm/droolsjbpm-integration/commit/ea3dbe3d4b34c0547 |
Created attachment 1130685 [details] demo maven project Description of problem: drools-workbench-models are missing from drools-karaf-features, resulting in ClassNotFoundException when using kjar-packaged rules that reference the models. In the attached example, when the simple ruleset is used, the feature deployes and executes correctly in the Fuse / Karaf environment, but when the ruleset leveraging the decision table is used, the deployment fails with: Exception in thread "Thread-63" java.lang.IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.compiler.GuidedDecisionTableProvider' at org.kie.internal.utils.ServiceRegistryImpl.get(ServiceRegistryImpl.java:169) at org.drools.compiler.compiler.GuidedDecisionTableFactory.loadProvider(GuidedDecisionTableFactory.java:42) at org.drools.compiler.compiler.GuidedDecisionTableFactory.getGuidedDecisionTableProvider(GuidedDecisionTableFactory.java:35) at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.guidedDecisionTableToPackageDescr(KnowledgeBuilderImpl.java:417) at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl$14.map(CompositeKnowledgeBuilderImpl.java:446) at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.buildResource(CompositeKnowledgeBuilderImpl.java:319) at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.buildPackageDescr(CompositeKnowledgeBuilderImpl.java:308) at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.buildPackages(CompositeKnowledgeBuilderImpl.java:114) at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:105) at org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:241) at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:64) at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:230) at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieModule(KieBuilderImpl.java:222) at org.kie.scanner.KieRepositoryScannerImpl.build(KieRepositoryScannerImpl.java:221) at org.kie.scanner.KieRepositoryScannerImpl.buildArtifact(KieRepositoryScannerImpl.java:171) at org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:127) at org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:122) at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.loadKieModuleFromMavenRepo(KieRepositoryImpl.java:130) at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:116) at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:93) at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:115) at org.drools.example.osgi.ProcessActivator$kieThread.run(ProcessActivator.java:38) Caused by: java.lang.IllegalArgumentException: Unable to instantiate 'org.drools.workbench.models.guided.dtable.backend.GuidedDecisionTableProviderImpl' at org.kie.internal.utils.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:273) at org.kie.internal.utils.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceRegistryImpl.java:265) at org.kie.internal.utils.ServiceRegistryImpl.get(ServiceRegistryImpl.java:167) ... 21 more Caused by: java.lang.ClassNotFoundException: org.drools.workbench.models.guided.dtable.backend.GuidedDecisionTableProviderImpl not found by org.kie.internalapi [279] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:195) at org.kie.internal.utils.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:270) ... 23 more Version-Release number of selected component (if applicable): 6.3.0-redhat-5 How reproducible: Consistently Steps to Reproduce: 1. Deploy JBoss Fuse 6.2.1 with Integration Pack 2. Build the attached project 3. From the Karaf console, execute "features:addurl mvn:com.redhat.example.rules/demo-rules-osgi/1.0-SNAPSHOT/xml/features" 4. From the Karaf console, execute "features:install -c demo-rules-demo" Actual results: Exception stack trace similar to above. Expected results: Feature loads and outputs to the console Additional info: If the loaded module / releaseId arguments on Line 36 of ProcessActivator.java (in the demo-rules-osgi project) is changed from "demo-project" to "demo-project-simple" (not referencing dtables), the project deploys and outputs as expected. Wrapping the model jars and enabling dynamic import on the KIE Internal and KIE CI bundles has been tried, as well as shading the model contents into the project bundles, but did not resolve the issue.