【问题标题】:Getting com.sun.jersey.api.client.ClientHandlerException: while generating Docusign API token获取 com.sun.jersey.api.client.ClientHandlerException: 同时生成 Docusign API 令牌
【发布时间】:2019-10-19 16:26:50
【问题描述】:

我是 Docusign 的新手,在我的 java 代码中生成 docusign 令牌时遇到了以下问题:

例外:

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)

我的球衣版本是 1.19.0

请告诉我哪里出错了。 下面是代码sn-p供参考:

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());

【问题讨论】:

标签: java docusignapi classcastexception


【解决方案1】:

请注意,DocuSign Java SDK 使用 Jersey 版本 1.19.1。这会导致冲突吗?

您是否尝试过使用Java JWT example

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-06-18
    • 1970-01-01
    • 1970-01-01
    • 2021-01-07
    • 1970-01-01
    • 2021-01-29
    • 2020-04-27
    相关资源
    最近更新 更多