ServiceLocatorUtilities.enablePerThreadScope method binds hk2-api bundle internal, PerThreadContext, class.
When ServiceHandleImpl class from hk2-locator is trying to retrieve the above context, it fails as hk2-locator bundle class loader is being used,
which does not see the PerThreadContext class. In a non-OSGi environment, this is not an issue, but it breaks in GF.
Attaching a patch, we put together with Marek and tested to resolve the issue.