GithubHelp home page GithubHelp logo

neverbounceapi-java's People

Contributors

david-borrowman avatar georgenov avatar laszlocsontos avatar mixedgit avatar mmollick avatar panditankur avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neverbounceapi-java's Issues

java.lang.IllegalArgumentException: expected primitive class

Hi,

We have integrated your email validation service and it works correctly, but sometimes exceptions are generated.
I think it may be due to a different response model than expected.

Exceptions:

java.lang.IllegalArgumentException: expected primitive class, but got: class com.neverbounce.api.client.exception.NeverbounceApiException
	at com.google.api.client.util.Data.parsePrimitiveValue(Data.java:456) ~[google-http-client-1.29.0.jar:?]
	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:871) ~[google-http-client-1.29.0.jar:?]
java.lang.IllegalArgumentException: 
	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:902) ~[google-http-client-1.29.0.jar:?]
	at com.google.api.client.json.JsonParser.parse(JsonParser.java:362) ~[google-http-client-1.29.0.jar:?]
	at com.google.api.client.json.JsonParser.parse(JsonParser.java:320) ~[google-http-client-1.29.0.jar:?]
	at com.google.api.client.json.JsonParser.parse(JsonParser.java:298) ~[google-http-client-1.29.0.jar:?]
	at com.neverbounce.api.internal.HttpClientImpl.translateHttpResponseException(HttpClientImpl.java:178) ~[neverbounce-api-java-4.0.14.jar:?]
	at com.neverbounce.api.internal.HttpClientImpl.execute(HttpClientImpl.java:133) ~[neverbounce-api-java-4.0.14.jar:?]
	at com.neverbounce.api.internal.HttpClientImpl.getForObject(HttpClientImpl.java:95) ~[neverbounce-api-java-4.0.14.jar:?]
	at com.neverbounce.api.model.SingleCheckRequest.execute(SingleCheckRequest.java:48) ~[neverbounce-api-java-4.0.14.jar:?]

Please, would it be possible to add an exception that retrieves the response body?

Testing with CURL, sometimes we got responses with the Result inconclusive, not expected.

Thank you in advance

NPE Exceptions when Invoking JobStatusRequest

Hey Guys,

I've been integrating into your service using the rather simple SingleCheck operation, which has been great if not slow. But due to the volume of emails we scan i've further integrated into the JobRequest operation to perform validations in bulk and faster.

We consume the latest version of your Java API, specifically version 4.0.5. When polling for JobStatuses we get parsing errors for response attribute "percent_complete", with the following stack trace.

Caused by: java.lang.IllegalArgumentException: key percent_complete at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:889) at com.google.api.client.json.JsonParser.parse(JsonParser.java:382) at com.google.api.client.json.JsonParser.parse(JsonParser.java:355) at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:87) at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:81) at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:459) at com.neverbounce.api.internal.HttpClientImpl.execute(HttpClientImpl.java:109) at com.neverbounce.api.internal.HttpClientImpl.getForObject(HttpClientImpl.java:84) at com.neverbounce.api.model.JobsStatusRequest.execute(JobsStatusRequest.java:23) at com.skymode.integrations.NeverbounceEmailSanitizer.sanitizeEmails(NeverbounceEmailSanitizer.java:137) at com.skymode.asynctasks.handlers.CustomerUploadAsyncTaskHandler.performEmailsSanitization(CustomerUploadAsyncTaskHandler.java:184) at com.skymode.asynctasks.handlers.CustomerUploadAsyncTaskHandler.handleTask(CustomerUploadAsyncTaskHandler.java:151) at com.skymode.asynctasks.handlers.CustomerUploadAsyncTaskHandler.handleTask(CustomerUploadAsyncTaskHandler.java:53) at com.skymode.asynctasks.handlers.AsyncTaskProcessor.call(AsyncTaskProcessor.java:58) at com.skymode.asynctasks.handlers.AsyncTaskProcessor.call(AsyncTaskProcessor.java:17) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at org.glassfish.enterprise.concurrent.internal.ManagedFutureTask.run(ManagedFutureTask.java:141) ... 4 more Caused by: java.lang.IllegalArgumentException: key percent_complete, field private int com.neverbounce.api.model.JobsStatusResponse.percentComplete at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:889) at com.google.api.client.json.JsonParser.parse(JsonParser.java:472) at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:781) ... 27 more Caused by: java.lang.NumberFormatException: For input string: "88.24" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.valueOf(Integer.java:766) at com.google.api.client.json.gson.GsonParser.getIntValue(GsonParser.java:90) at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:836) ... 29 more

It appears that the wrong datatype has been chosen in JobStatus to represent the percentage complete, which comes back as a float.

M5: Adjust endpoint responses according to latest changes and re-enable test case JobsSearchResponseTest

One thing which need refinement for sure is that /jobs/status the actual status of the job as job_status, whereas /jobs/search returns seemingly the same structure, but job status is called status.
The class I'm using to deserialize job's status has got a member called jobStatus which is mapped to job_status JSON field. When this piece of data gets returned as status, the runtime tried to deserialize it as the request's status and it fails.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.