Need to set on-invalid = null , because the service definition is removed in dependency injection if best match is not used.