throwing an exception when no port is available instead of returning -1 to get better trace in logs