java.net.ConnectException: Connection Refused

updated the original post with the code.