Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1117

ServiceManager does not work in OSGi environment

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.x
    • 4.5.0
    • osgi
    • None

    Description

      ServiceManager essentially looks for the ServerService resource files in its classloader hierarchy. This works well in regular Java environment where usually the openejb-server jar would be in the same classloader as any of the ServerService implementations. However, in OSGi environment the openejb-server and the different ServerService implementations are separate bundles and effectively have separate classloaders. As a result, the ServiceManager in OSGi environment is unable to discover the ServerService resource files provided by the different "server" bundles.

      Side note: There are actually a number of problems here. One main problem is in the xbean ResourceFinder class. It does not understand how to deal with "bundle" urls returned by classloader.getResource() lookup. But even if it was fixed to support the "bundle" urls it would still not find the ServerService resources in other bundles since they would not be accessible from openejb-server bundle classloader. There are ways of making the ServerService resources in other bundles visible to openejb-server bundle but they are not desirable solutions (e.g. making "server" bundles into fragment bundles or making openejb-server Require-Bundle the different "server" bundles, etc.).

      Attachments

        1. OPENEJB-1117.patch
          40 kB
          Jarek Gawor

        Activity

          People

            Unassigned Unassigned
            gawor@mcs.anl.gov Jarek Gawor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: