Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing response #1

Open
mjoc13 opened this issue Mar 13, 2019 · 1 comment
Open

Error parsing response #1

mjoc13 opened this issue Mar 13, 2019 · 1 comment

Comments

@mjoc13
Copy link

mjoc13 commented Mar 13, 2019

Hello,
When invoking the createJob() i am receiving the following:
...
23:03:59.161 [main] INFO endolabs.salesforce.bulkv2.Bulk2ClientBuilder - <-- END HTTP (512-byte body)
java.io.UncheckedIOException: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'okhttp3': was expecting ('true', 'false' or 'null')
at [Source: (String)"okhttp3.internal.http.RealResponseBody@42a48628"; line: 1, column: 8]

Looks like it might be an okhttp3 issue, as when the interceptor is enabled its printing the body, and i can see it.
From the documentation the body is only read once, as its a buffered stream, so my initial thought it was the interceptor closing the stream before the code gets a handle on the body.
Removing the http body interceptor still yields the same result.

Updated: Issue resolved, by using responseBody.string() over responseBody.toString(), followed by closing the responseBody.close() - will also need to handle an IOExcecption.
Also Salesforce has the concept of a closed job, added to JobStateEnum.

@srayhunter
Copy link
Contributor

Created a pull request for the responseBody changes. Ran into this issue and fixed the issue in the PR. I did not add the Closed job state to the JobStateEnum though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants