License Type | SaaS & On-Premise |
Agent Mode | Assess & Protect |
Main Product Category | Contrast SDK |
Sub Category | Connectivity |
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";