0

I am new for Docusign and getting below issue while generating the docusign token within my java code:

Exception:

com.sun.jersey.api.client.ClientHandlerException: 
java.lang.ClassCastException: com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl cannot be cast to javax.net.ssl.HttpsURLConnection
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:155)
        at com.sun.jersey.api.client.Client.handle(Client.java:652)
        at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
        at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
        at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:570)
        at com.docusign.esign.client.ApiClient.requestJWTUserToken(ApiClient.java:732)
        at com.esp.quativa.service.DocuSignConfigurationService.configureApiClent(DocuSignConfigurationService.java:245)

My jersey version is 1.19.0

Please let me know where I am going wrong. Below is the code snippet for reference:

List<String> scopes = new ArrayList<String>();
scopes.add(OAuth.Scope_SIGNATURE);
scopes.add(OAuth.Scope_IMPERSONATION);
byte[] privateKeyBytes = null;
try {
  privateKeyBytes = Files.readAllBytes(Paths.get(privateKeyAbsPath));
} catch (IOException ioExcp) {
  logger.error("Exception while reading docusign private key :::"+ioExcp);
}
OAuth.OAuthToken oAuthToken = apiClient.requestJWTUserToken(integratorKey, userGUId, scopes, privateKeyBytes, 3600);
apiClient.setAccessToken(oAuthToken.getAccessToken(), oAuthToken.getExpiresIn());
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • Did you try anything..? https://stackoverflow.com/questions/23517139/java-lang-classcastexception-com-sun-net-ssl-internal-www-protocol-https-httpsu might be simlar – AsthaUndefined Jun 04 '19 at 07:20
  • Possible duplicate of [java.lang.ClassCastException: com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl cannot be cast to javax.net.ssl.HttpsURLConnection](https://stackoverflow.com/questions/23517139/java-lang-classcastexception-com-sun-net-ssl-internal-www-protocol-https-httpsu) – AsthaUndefined Jun 04 '19 at 07:21
  • In my case I am not passing http path anywhere explicitly. – Venkat Sai Jun 04 '19 at 08:08

1 Answers1

0

Note that the DocuSign Java SDK uses Jersey version 1.19.1. Could that be causing the conflict?

Have you tried using the Java JWT example?

Larry K
  • 47,808
  • 15
  • 87
  • 140