Based on the following documentation, we have set setConnectTimeout and setReadTimeout to 300000 milliseconds, but even after 30 minutes have passed, no timeout error occurs and the application continues to wait for a response from Box.
https://opensource.box.com/box-java-sdk/javadoc/com/box/sdk/BoxAPIConnection.html
When we captured a thread dump while waiting for a response, we observed the following stack trace:
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:352)
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:720)
at com.box.sdk.BoxAPIRequest.sendWithoutRetry(BoxAPIRequest.java:378)
at com.box.sdk.BoxDeveloperEditionAPIConnection.authenticate(BoxDeveloperEditionAPIConnection.java:439)
at com.box.sdk.BoxDeveloperEditionAPIConnection.tryRestoreUsingAccessTokenCache(BoxDeveloperEditionAPIConnection.java:571)
at com.box.sdk.BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(BoxDeveloperEditionAPIConnection.java:219)
at com.box.sdk.BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(BoxDeveloperEditionAPIConnection.java:250)
Sometimes timeout errors do occur. In such cases, we see the following stack trace:
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:352)
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:720)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:433)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:400)
at com.box.sdk.JsonIterator.loadNextPage(JsonIterator.java:68)
at com.box.sdk.JsonIterator.loadNextJsonObject(JsonIterator.java:102)
at com.box.sdk.JsonIterator.hasNext(JsonIterator.java:29)
at com.box.sdk.BoxItemIterator.hasNext(BoxItemIterator.java:36)
It appears that the timeout settings do not work when the authenticate method is being executed.
Is there any configuration in box-java-sdk that can force timeout errors to occur even in the cases described above?