Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2682

ServiceRegistryImpl is registered twice: once as a singleton and once as a service tracker

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.2.0.M1
    • 5.2.0.M1
    • drools-api
    • None
    • Hide

      Place Drools inside an OSGi container, and use a separate bundle to run this code:

      KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();

      Show
      Place Drools inside an OSGi container, and use a separate bundle to run this code: KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();

    Description

      This bug occurs when using Drools inside an OSGi environment. The ServiceRegistryImpl is instantiated instead of using the instance singleton, which leads to having objects being registered against the wrong ServiceRegistry. The OSGi class loader won't let the default instantiator work, as the classes are part of a different bundle. As a result, the configuration of the knowledge base fails.

      The patch attached fixes this problem, it is a one liner.

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            atoulme_jira Antoine Toulme (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty