Runpath and boot delegation

The Context: We run an OSGi Container inside a Spring Application and provide Services as Spring Components (Don’t ask why… :slight_smile: ).

We export a bndrun and have our own little prelauncher to call the bnd launcher.

So, Everything that comes from the surrounding Spring container, must be set provided via -runpath and also added via boot delegation.

Here is the question now: Do we have a mechanism to automatically create the list of boot delegation packages from the runpath entries?

… this is Liferay Portal in a nutshell.

From my experience the list of packages exported from the outer runtime needs to be manually curated otherwise you might have things you want to be pure OSGi but cannot because you end up with a poisoned class space.

1 Like

I agree with Ray that this is the easiest way to make the OSGi site a dumpster fire. It is by far the hardest part of Launchpad. Launchpad calculates the classes that need to be exported from the testpath by looking at what is needed from the test classes. If you really have to do this, then Launchpad code might help although it does the calculations in the driver via the RemoteWorkspace. The reason for this indirection that if you do it on the target, bnd’s implementation classes will add to your nightmare.

When used with API based bundles, it all works like a charm. Add an implementation package and say hi to hell and bye to a good night sleep.

The only way to make this work well is have a strict API definition in interfaces and only share those packages.

The good thing in my case is, that we have a clear API line. For now, I scan the Classpath in my launcher and create the boot delegation list at start time directly as a Launcher Property.

Let’s see, when the house starts burning down because of that :-).

Thanks for the Advice