adjust repository factory to throw exception instead of returning null

This seems to be a leftover from an oddity of how java service provisioning works. PHP does not do that, so throwing an exception is more explicit and a lot easier to debug.