shred / shariff-backend-java

A Java servlet and backend for Shariff
Apache License 2.0
2 stars 3 forks source link

HttpTarget.count throws HTTP 400 for Facebook #4

Closed mb73 closed 6 years ago

mb73 commented 6 years ago

First of all: Thanks for the nice Java backend :)

I have a little project which does not use Maven. After finding out where to get the json.jar (the link you provided is dead by now) and that you also need a slf4j-api.jar I still get an error although I provided a facebook.id and facebook.secret (of an App I created yesterday for this purpose).

java.io.IOException: HTTP 400: Bad Request
    at org.shredzone.shariff.api.HttpTarget.count(HttpTarget.java:53)
    at org.shredzone.shariff.target.Facebook.count(Facebook.java:64)
    at org.shredzone.shariff.ShariffBackend.lambda$null$2(ShariffBackend.java:147)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

both for the Servlet and for the command line. Please help.

shred commented 6 years ago

Thank you! As I'm not using Facebook, I appreciate your feedback. It seems that the Facebook Graph API v2.8 is outdated. I migrated the code to API v2.12.

Can you try this updated backend.zip file? GitHub does not support the upload of a JAR file here, so I had to pack it into a ZIP file.

mb73 commented 6 years ago

Thanks for the quick reply! Unfortunately I get exactly the same error message with the snapshot.

No problem for me, though. I realized that I don’t really need those counters and thus removed the backend …

shred commented 6 years ago

I've updated to Facebook API v3.0. It's like the shariff-backend-php now, so I hope it's working.

Do you have a way to give it a try, even if you removed the backend? backend.zip

T3rm1 commented 6 years ago

I can confirm that it works.

shred commented 6 years ago

Thank you. I will release an update soon.