This is my example code. It can run in local machine, but when deploy to EC2 instance of Amazon AWS, error was occured.

public class SalesforceMarketingCloudDBService {

  private static final Logger logger = LogManager.getLogger(SalesforceMarketingCloudDBService.class);
  private ETConfiguration configuration;
  private Soap stub;

  public SalesforceMarketingCloudDBService() {
    configuration = new ETConfiguration();

    ETClient client;
    try {
        client = new ETClient(configuration);
        stub = client.getSoapConnection().getSoap();
    } catch (ETSdkException e) {
        logger.error("SOAP Init Failed:", e);

And this is logs generated by log4j

 ERROR - SOAP Init Failed:
 java.lang.IllegalStateException: Already connected
    at sun.net.www.protocol.http.HttpURLConnection.getRequestProperties(HttpURLConnection.java:3103) ~[?:1.8.0_102]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getRequestProperties(HttpsURLConnectionImpl.java:358) ~[?:1.8.0_102]
    at com.exacttarget.fuelsdk.ETRestConnection.sendRequest(ETRestConnection.java:278) ~[fuelsdk-1.2.1.jar:?]
    at com.exacttarget.fuelsdk.ETRestConnection.sendRequest(ETRestConnection.java:223) ~[fuelsdk-1.2.1.jar:?]
    at com.exacttarget.fuelsdk.ETRestConnection.post(ETRestConnection.java:135) ~[fuelsdk-1.2.1.jar:?]
    at com.exacttarget.fuelsdk.ETClient.requestToken(ETClient.java:330) ~[fuelsdk-1.2.1.jar:?]
    at com.exacttarget.fuelsdk.ETClient.requestToken(ETClient.java:292) ~[fuelsdk-1.2.1.jar:?]
    at com.exacttarget.fuelsdk.ETClient.<init>(ETClient.java:156) ~[fuelsdk-1.2.1.jar:?]

sorry you're running into this problem. This issue is fixed in version 1.2.2 of the SDK which we've just published to Maven Central. Please can you try v1.2.2 and let us know if you're still seeing this problem?

Thanks Sharif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.