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

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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 5.2.0.M1
    • Fix Version/s: 5.2.0.M1
    • Component/s: drools-api
    • Labels:
      None
    • Steps to Reproduce:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mark.proctor Mark Proctor
                Reporter:
                atoulme Antoine Toulme
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: