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.).