Closed GoogleCodeExporter closed 8 years ago
Can you post the code, stack trace, and the log4j output?
Thanks!
Original comment by mark.a.a...@gmail.com
on 24 Aug 2010 at 1:45
[deleted comment]
[deleted comment]
Hi Mark!
Code:
facebookClient.publish("me/videos", FacebookType.class, inputStream,
Parameter.with("message", title), Parameter.with("description", description));
The FacebookNetworkException holds:
httpStatusCode = 400
detailMessage = A network error occurred while trying to communicate with
Facebook: Facebook POST failed (HTTP status code 400)
cause = null
stackTrace = null
Note that the same happens when I try to use facebookClient.deleteObject(id);
Thank you!
Original comment by ParaTest...@gmail.com
on 8 Sep 2010 at 7:05
Can you post the stack trace and log4j output? I'm guessing your token has
expired or does not have valid permissions to perform these actions. There is
a bug in RestFB 1.5.3 (fixed in trunk) that will throw a
FacebookNetworkException if your access token is invalid.
Can you verify that you've followed these instructions from restfb.com?
A note about the Publish and Delete examples below
In order to use these, you'll need to create a Facebook Application and then
request an OAuth2 access token with the proper permissions, e.g.
publish_stream,offline_access,create_event.
The Facebook Graph API authorization documentation explains how to do this in
detail.
If you're in a hurry, though, here's a quick example:
Create a Facebook Application
Request https://graph.facebook.com/oauth/authorize?client_id=MY_API_KEY&
redirect_uri=http://www.facebook.com/connect/login_success.html&
scope=publish_stream,offline_access,create_event
Facebook will redirect you to
http://www.facebook.com/connect/login_success.html? code=MY_VERIFICATION_CODE
Request https://graph.facebook.com/oauth/access_token?client_id=MY_API_KEY&
redirect_uri=http://www.facebook.com/connect/login_success.html&
client_secret=MY_API_SECRET&code=MY_VERIFICATION_CODE
Facebook will respond with access_token=MY_ACCESS_TOKEN
Original comment by mark.a.a...@gmail.com
on 10 Sep 2010 at 3:47
I'm closing this out since I haven't heard back. If you're still having
issues, please re-open.
Original comment by mark.a.a...@gmail.com
on 27 Dec 2010 at 6:18
I'm also seeing this issue. I've just run the code example from the following
location
(http://code.google.com/p/restfb/source/browse/trunk/RestFB/source/examples/com/
restfb/example/GraphPublisherExample.java?r=260&spec=svn260)
and I'm getting the error below, there isn't any problem with the post of the
status update just the deletion operation:
Published message ID: xxxxxxxxxx_yyyyyyyyyy
* Object deletion *
Exception in thread "main" com.restfb.exception.FacebookNetworkException: A
network error occurred while trying to communicate with Facebook: Facebook
request failed (HTTP status code null)
at com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:520)
at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:496)
at com.restfb.DefaultFacebookClient.deleteObject(DefaultFacebookClient.java:202)
at main.java.com.tango.app.GraphPublisherExample.delete(GraphPublisherExample.java:95)
at main.java.com.tango.app.GraphPublisherExample.runEverything(GraphPublisherExample.java:51)
at main.java.com.tango.app.GraphPublisherExample.main(GraphPublisherExample.java:42)
Caused by: java.lang.NullPointerException
at com.restfb.DefaultWebRequestor.executePost(DefaultWebRequestor.java:135)
at com.restfb.DefaultFacebookClient$2.makeRequest(DefaultFacebookClient.java:502)
at com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:518)
... 5 more
Original comment by collins....@gmail.com
on 12 Jul 2011 at 4:18
Hi there - what version of RestFB are you using (looks like it might be an old
one)?
Original comment by mark.a.a...@gmail.com
on 12 Jul 2011 at 4:36
1.6.5?
Original comment by collins....@gmail.com
on 12 Jul 2011 at 4:41
Huh, odd - let me check it out. Thanks for the heads-up!
Original comment by mark.a.a...@gmail.com
on 12 Jul 2011 at 5:53
Raised issue 145 to track this before you got a chance to reply so I you want
to close one off as a duplicate issue thats fine.
Thanks for your help
Garret
Original comment by collins....@gmail.com
on 12 Jul 2011 at 5:59
No problem - glad you caught this. I have found the cause and will fix and put
out 1.6.6 tonight. The bug was accidentally introduced in 1.6.5.
Original comment by mark.a.a...@gmail.com
on 12 Jul 2011 at 6:04
Original issue reported on code.google.com by
testbot....@gmail.com
on 24 Aug 2010 at 1:22