docusign / docusign-esign-java-client

The Official Docusign Java Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://javadoc.io/doc/com.docusign/docusign-esign-java/latest/index.html
MIT License
105 stars 96 forks source link

Issue after upgrade: No message body reader has been found for class com.docusign.esign.client.auth.OAuth$OAuthToken, ContentType: application/json;charset=utf-8 #163

Closed ajesk closed 2 years ago

ajesk commented 4 years ago

After updating our docusign dependency to 3.8.0 from 2.8.0 (we also attempted 2.9.0) I am finding that we are now seeing the title error popping up when making a request.

[2020.09.14 11:54:02.230 [localhost] ERROR http-nio-8080-exec-9 JAXRSUtils:1807] [GUID=3436fca3-aa37-43aa-87e9-47e199ca5d8a] No message body reader has been found for class com.docusign.esign.client.auth.OAuth$OAuthToken, ContentType: application/json;charset=utf-8 [2020.09.14 11:54:02.231 [localhost] ERROR http-nio-8080-exec-9 DocusignAuthenticationService:80] [GUID=3436fca3-aa37-43aa-87e9-47e199ca5d8a] Unknown error getting docusign access token javax.ws.rs.client.ResponseProcessingException: No message body reader has been found for class com.docusign.esign.client.auth.OAuth$OAuthToken, ContentType: application/json;charset=utf-8 at org.apache.cxf.jaxrs.impl.ResponseImpl.reportMessageHandlerProblem(ResponseImpl.java:434) ~[cxf-rt-frontend-jaxrs-3.2.5.jar:3.2.5] at org.apache.cxf.jaxrs.impl.ResponseImpl.doReadEntity(ResponseImpl.java:387) ~[cxf-rt-frontend-jaxrs-3.2.5.jar:3.2.5]

Nothing in the library call changed.

apiClient.requestJWTUserToken(configuration.getIntegratorKey(), configuration.getUserId(), DEFAULT_SCOPES, configuration.getPrivateKey().getBytes(), JWT_TOKEN_TIMEOUT)

While stepping through the execution of the auth I am seeing that the API itself returns a success response with the following (trimmed) block.

{"access_token":"itsasecretaccesstokensorrry","token_type":"Bearer","expires_in":3600}

Everything looks normal, but for some reason it is unable to map the JSON to the object after the request is made. Any suggestions or tweaks that might help alleviate this issue.

mmallis87 commented 3 years ago

@ajesk do you mind sharing the code snippet that triggers this error.

FYI 3.8.0 and above use Jersey2 instead of Jersey1. Do you mind trying with 3.6.0 or lower and share the results?

mmallis87 commented 3 years ago

@ajesk If we don't hear back from you on this issue it will be automatically closed in 3 days. Feel free to reopen it if the problem persists.

albertorugnone commented 3 years ago

Hi I have the same problem with 3.12.0 using SDK rpvided by com.docusign:docusign-esign-java:3.12.0 In my case I request a JWT grant type authentication and after I have authorized my app, I solved creating ApiClient in this way (I can't find any other way)

    ApiClient apiClient = new ApiClient(){
            @Override
            protected void performAdditionalClientConfiguration(ClientConfig clientConfig) {
                clientConfig.register(new JacksonJsonProvider());
            }
        };

I hope it helps

mmallis87 commented 3 years ago

@albertorugnone thank you for sharing your experience and your fix. I created a ticket to get this fixed, hopefully in the next release.

Until then do you mind sharing more information about what Java environment you're running this under and what frameworks and related libraries you're using? This issue is hard to reproduce on most Java environments so your help will be greatly appreciated!

mmallis87 commented 2 years ago

Closing the issue since we have a fix for more than 5 months now and haven't heard any feedback from the reporter.

nagalakshmihn commented 2 years ago

I am facing this issue after upgrading to 3.18.0 version. Any help will be greatly appreciated.

henrywtam commented 2 years ago

@nagalakshmihn can you please share your code and logs? I'm guessing it may relate to this issue: https://stackoverflow.com/questions/30132336/how-to-register-jackson-json-provider-for-cxf-jax-rs-2-0-client. I'll be looking out for it.