GenesysAPI error (Connection reset)

When I executed GenesysAPI in a Java program, I got the following error.
What is the cause of the error?

Once the GenesysAPI is successfully executed and the return value is obtained, if the GenesysAPI is immediately executed, the following error message appears
If you execute GenesysAPI after about 30 minutes, it succeeds.

Is there an access token release process or something else that needs to be done?

■GenesysAPI Execution Procedure
1.Obtain access token by specifying clientId,clientSecret,region,userId
2.Build apiClient with access token

■Error
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:221)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at com.ibm.jsse2.ak.a(ak.java:111)
at com.ibm.jsse2.ak.g(ak.java:192)
at com.ibm.jsse2.ak.b(ak.java:52)
at com.ibm.jsse2.a0.a(a0.java:35)
at com.ibm.jsse2.bj.b(bj.java:451)
at com.ibm.jsse2.bj.f(bj.java:182)
at com.ibm.jsse2.bj.a(bj.java:508)
at com.ibm.jsse2.bj.startHandshake(bj.java:60)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at com.mypurecloud.sdk.v2.connector.apache.ApacheHttpClientConnector.invoke(ApacheHttpClientConnector.java:71)
at com.mypurecloud.sdk.v2.ApiClient.getAPIResponse(ApiClient.java:749)
at com.mypurecloud.sdk.v2.ApiClient.authorizeClientCredentials(ApiClient.java:301)
at com.genesysadapter.agent.user.UserAPI.getAccessToken(UserAPI.java:117)
at com.testapp.test.testApp.main(testApp.java:64)

■Other Information
・java version "1.8.0_331"(IBM)
・platform-client-v2-149.0.1.jar

Hi,

Can you provide more context here or some example code? Are you using a proxy for requests?

Thanks,

Mike

Hi Michael_Roddy,

The proxy is used, but an error occurs in the method before the proxy is used.
Specifically, there is an error in userAPI.getAccessToken.

==========================
UserAPI userAPI = new UserAPI();

TokenProperty tokenProperty = userAPI.getAccessToken(clientId, clientSecret,
PureCloudRegionHosts.valueOf(region), userId);
log.info("Region :" + tokenProperty.getRegion());

log.info("access token :" + tokenProperty.getToken());

// Create ApiClient instance ApiClient apiClient =
ApiClient apiClient = null;
if (isProxy.equalsIgnoreCase("yes")) {

log.info("inside proxy call :" + proxyUrl);

apiClient = ApiClient.Builder.standard().withAccessToken(tokenProperty.getToken()).withBasePath(tokenProperty.getRegion())
.withAuthenticatedProxy(
new Proxy(Type.HTTP, new InetSocketAddress(proxyUrl, Integer.parseInt(proxyPort))),
proxyUsername, proxyPassword)
.build();
} else {
apiClient = ApiClient.Builder.standard().withAccessToken(tokenProperty.getToken())
.withBasePath(tokenProperty.getRegion()).build();
}

Best regards.

This error has a similar root to your other post that seems to be coming from your custom IBM runtime. Can you reproduce this error using OpenJDK?

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.