salesforce-marketingcloud / FuelSDK-Java

Salesforce Marketing Cloud Java SDK
BSD 3-Clause "New" or "Revised" License
73 stars 122 forks source link

Already connected exception #62

Closed satterly closed 7 years ago

satterly commented 7 years ago

When I update my application from Fuel SDK version 1.2.0 to 1.2.1 I get an "Already connected" exception...

play.api.UnexpectedException: Unexpected exception[IllegalStateException: Already connected]
Caused by: java.lang.IllegalStateException: Already connected
    at sun.net.www.protocol.http.HttpURLConnection.getRequestProperties(HttpURLConnection.java:3142)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getRequestProperties(HttpsURLConnectionImpl.java:358)
    at com.exacttarget.fuelsdk.ETRestConnection.sendRequest(ETRestConnection.java:278)
    at com.exacttarget.fuelsdk.ETRestConnection.sendRequest(ETRestConnection.java:223)
    at com.exacttarget.fuelsdk.ETRestConnection.post(ETRestConnection.java:135)
    at com.exacttarget.fuelsdk.ETClient.requestToken(ETClient.java:330)
    at com.exacttarget.fuelsdk.ETClient.requestToken(ETClient.java:292)
    at com.exacttarget.fuelsdk.ETClient.<init>(ETClient.java:156)
    at services.ExactTargetApi.<init>(ExactTargetApi.scala:15)
    at AppComponents.exactTarget$lzycompute(AppComponents.scala:35)
sharif26 commented 7 years ago

Thanks for your feedback @satterly So there seems to be an issue depending on Log Level, so I would suggest you to try the below line before calling our SDK client.

Logger.getRootLogger().setLevel(Level.INFO); //org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.INFO); ETClient client = new ETClient("fuelsdk.properties");

The second line is just to clarify the imports, use whichever suits you. And any Log Level other than Level.DEBUG should work.

We shall definitely fix that in our next release.

satterly commented 7 years ago

Thanks. I can confirm that works.