我是 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
请让我知道我哪里出错了。以下是供参考的代码片段:
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());
请注意,DocuSign Java SDK 使用 Jersey 版本 1.19.1。这会引起冲突吗?
您是否尝试过使用 Java JWT 示例?