We now need to do something like: ServiceRegistry registry = context.getServiceRegistry(true);

In order to also check whether the user is allowed to execute that operation. Only acquiring the lock is not sufficient according to my information.