Connection Error with SDK: Connection refused

  • Updated

Issue

When trying to make a connection back to the Contrast UI using the SDK, the following error is thrown:

Exception in thread "main" java.net.ConnectException: Connection refused

Cause

This error is commonly thrown when you specify an incorrect apiUrl.

Resolution

SaaS customers do not need to explicitly specify the API url because it will use the default. However, on-premise customers should check to verify that the full URL is being specified to the Contrast API. For example:

String apiUrl = "http://localhost:19080/Contrast/api";

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request