[rules-users] kContainer.newKieSession() fails in Apache Karaf

Charles Moulliard ch007m at gmail.com
Thu Jan 23 11:35:17 EST 2014


Hi Joseph,

I propose that you have a look to this example which is currently working
on Karaf - https://github.com/cmoulliard/droolsjbpm-osgi-examples (simple =
OSGI BundleActivator + KieSession + Drools Rules)

Regards,

Charles


On Thu, Jan 23, 2014 at 4:58 PM, jhusby <husby024 at umn.edu> wrote:

> I wasn't subscribed to the mailing list so I don't think my message below
> went through.  Apologies if it did.
>
>
> jhusby wrote
> > I'm trying to run Drools in an OSGi container (Apache Karaf 2.3.3 to be
> > precise).  When I try to call newKieSession() on a KieContainer, I get an
> > exception as follows:
> >
> > java.lang.IllegalArgumentException: conflict Resolver
> > 'org.drools.core.conflict.DepthConflictResolver' not found
> >       at
> >
> org.drools.core.RuleBaseConfiguration.determineConflictResolver(RuleBaseConfiguration.java:868)[276:org.drools.core:6.0.1.20131220-0333]
> >       at
> >
> org.drools.core.RuleBaseConfiguration.init(RuleBaseConfiguration.java:459)[276:org.drools.core:6.0.1.20131220-0333]
> >       at
> >
> org.drools.core.RuleBaseConfiguration.init(RuleBaseConfiguration.java:415)[276:org.drools.core:6.0.1.20131220-0333]
> >       at org.drools.core.RuleBaseConfiguration.
> > <init>
> > (RuleBaseConfiguration.java:402)[276:org.drools.core:6.0.1.20131220-0333]
> >       at
> >
> org.drools.core.impl.KnowledgeBaseFactoryServiceImpl.newKnowledgeBaseConfiguration(KnowledgeBaseFactoryServiceImpl.java:37)[276:org.drools.core:6.0.1.20131220-0333]
> >       at
> >
> org.kie.internal.KnowledgeBaseFactory.newKnowledgeBaseConfiguration(KnowledgeBaseFactory.java:125)[275:org.kie.internalapi:6.0.1.20131220-0322]
> >       at
> >
> org.drools.compiler.kie.builder.impl.KieContainerImpl.getKnowledgeBaseConfiguration(KieContainerImpl.java:323)[277:org.drools.compiler:6.0.1.20131220-0333]
> >       at
> >
> org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:316)[277:org.drools.compiler:6.0.1.20131220-0333]
> >       at
> >
> org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:257)[277:org.drools.compiler:6.0.1.20131220-0333]
> >       at
> >
> org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:400)[277:org.drools.compiler:6.0.1.20131220-0333]
> >       at
> >
> org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:349)[277:org.drools.compiler:6.0.1.20131220-0333]
> >       at
> >
> org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:331)[277:org.drools.compiler:6.0.1.20131220-0333]
> >
> > As a workaround, I was able to get it working by doing this:
> >
> >       KieBaseConfiguration kbaseConf = KnowledgeBaseFactory
> >
> .newKnowledgeBaseConfiguration(
> >                                                       null,
> >
> getClass().getClassLoader(),
> >
> RuleBaseConfiguration.class.getClassLoader()
> >                                               );
> >       KieBase kbase = kContainer.newKieBase(kbaseConf);
> >       kSession = kbase.newKieSession();
> >
> > but this is obviously less than ideal.  Any ideas on how to make this
> work
> > better in OSGi?
> >
> > Thank you!
> >
> > Joseph
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/kContainer-newKieSession-fails-in-Apache-Karaf-tp4027815p4027832.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140123/2cf4d8a5/attachment.html 


More information about the rules-users mailing list