Fixed NumberFormat Exception when uri is missing the port

JAVA-913 JAVA-1357