We use "deploy --type osgi <osgi-enabled-hk2-bundle>.jar" which helps to install an osgi bundle as application in GlassFish
This also exposes the hk2 services in the bundle.
When uninstalling the bundle (or via "undeploy appName") that has hk2 services, these services are still listed in the runtime.
eg: habitat.getAllByContract(..) will also list the HK2 Service implementation that was actually removed as part of uninstalling the bundle.
Accessing such an entry results in class-not-found-exceptions.
This seems to be a bug. Once GlassFish is restarted, the stale entries are removed as expected.