I think you want `setContext`, via `ACL.impersonate(ACL.SYSTEM)`, not `setAuthentication` on the existing context. See the Javadoc of `impersonate` for the justification (thread safety).