throw exception if cannot resolve port number conflict after maxAttempt

throw exception if cannot resolve port number conflict after maxAttempt