0

Previously I am using

public class MyModule extends AbstractModule {
@Override
    protected void configure() {
       requireBinding(KieResources.class);
       requireBinding(KnowledgeBaseFactoryService.class);
       requireBinding(KnowledgeBuilderFactoryService.class);
   }
}

but due to vulnerability in old binaries we have decided to upgrade drools to 7.74.1 version and we are using google guice version 6.0.0 in OSGI project so according to new API, I have modified the code and got to know that KnowledgeBaseFactoryService we can replace with KieServices so trying to bind as below but always getting Unsatisfied Service Name: org.kie.api.KieServices
attaching screenshot for reference.

public class MyModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(MyService.class).to(MyServiceImpl.class).in(Scopes.SINGLETON);
    }

    @Provides
    KieServices provideKieServices() {
        return KieServices.Factory.get();
    }enter image description here
}

also tried

public class MyModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(KieServices.class).toInstance(KieServices.Factory.get())
        bind(MyService.class).to(MyServiceImpl.class).in(Scopes.SINGLETON);
    }
}

But didn't worked please help us with solution.

4
  • There's no "screenshot attached for reference", but if it was a picture of code then that's good that it is not attached. "Didn't work" is not a good description of the problem, please elaborate on what actually happens. Commented Feb 20, 2024 at 13:38
  • 1
    private provideKieServices() method? Commented Feb 20, 2024 at 17:05
  • Its still saying Unsatisfied Service Name: org.kie.api.KieServices in both cases in felix webconsole and my component were not registered. Commented Feb 21, 2024 at 5:43
  • we have tried to bind new AbstractModule() {@Override protected void configure() {bind(KieServices.class).toInstance(KieServices.Factory.get());} but on KieServices.Factory.get() getting null pointer exception. I am using 7.74.1 version Commented Feb 23, 2024 at 4:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.