fix bug that if the service type is not registered, then resolve directly will throw exception