Bug 1022881 - Error creating a KieBaseConfiguration in a OSGi environment with a custom ClassLoader
Error creating a KieBaseConfiguration in a OSGi environment with a custom Cla...
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.0.0
Unspecified Unspecified
high Severity high
: ER5
: 6.0.0
Assigned To: Mario Fusco
Marek Winkler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-24 04:46 EDT by Mario Fusco
Modified: 2014-08-06 16:18 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:18:19 EDT
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)

  None (edit)
Description Mario Fusco 2013-10-24 04:46:49 EDT
It is possible to create a KieBaseConfiguartion with an user provided ClassLoader from the KieServices. This is especially useful in OSGi environment, however when you do so it also tries to create a default configuration without using the provided classloader causing an Exception like the following:

java.lang.ExceptionInInitializerError
        at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieBaseConfiguration(KieServicesImpl.java:153)
        at de.hs_rm.cs.vs.drools.reasoner.base.AbstractReasoner.compileRules(AbstractReasoner.java:149)
        at de.hs_rm.cs.vs.owl.drools.reasoner.Reasoner.activate(Reasoner.java:87)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:236)
        at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:37)
        at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:613)
        at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:496)
        at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:149)
        at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:239)
        at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:119)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:1518)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:550)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:261)
        at org.apache.felix.scr.impl.config.ImmediateComponentHolder.enableComponents(ImmediateComponentHolder.java:328)
        at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:158)
        at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:113)
        at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:261)
        at org.apache.felix.scr.impl.Activator.loadAllComponents(Activator.java:199)
        at org.apache.felix.scr.impl.Activator.start(Activator.java:108)
        at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
        at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
        at aQute.launcher.Launcher.update(Launcher.java:378)
        at aQute.launcher.Launcher.activate(Launcher.java:303)
        at aQute.launcher.Launcher.run(Launcher.java:193)
        at aQute.launcher.Launcher.main(Launcher.java:89)
    Caused by: java.lang.IllegalArgumentException: conflict Resolver 'org.drools.core.conflict.DepthConflictResolver' not found
        at org.drools.core.RuleBaseConfiguration.determineConflictResolver(RuleBaseConfiguration.java:866)
        at org.drools.core.RuleBaseConfiguration.init(RuleBaseConfiguration.java:457)
        at org.drools.core.RuleBaseConfiguration.init(RuleBaseConfiguration.java:413)
        at org.drools.core.RuleBaseConfiguration.<init>(RuleBaseConfiguration.java:264)
        at org.drools.core.RuleBaseConfiguration.<clinit>(RuleBaseConfiguration.java:174)
        ... 31 more
Comment 2 Mario Fusco 2013-10-24 04:51:07 EDT
Fixed by https://github.com/droolsjbpm/drools/commit/1481152aa
Comment 3 Marek Winkler 2013-12-13 09:38:45 EST
The verification of this BZ is blocked by BZ 1042867.
Comment 4 Marek Winkler 2013-12-17 06:04:42 EST
Found a workaround for BZ 1042867 (created a simple OSGi bundle with custom BundleActivator which creates a KieBase with custom classloader).

Verified on BRMS 6.0.0 ER5.

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