bobolounna / restfb

Automatically exported from code.google.com/p/restfb
0 stars 0 forks source link

FacebookType publishVideoResponse = facebookClient.publish("me/videos",... #72

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Based on Example in RestFB, made call to  
facebookClient.publish("me/videos",... instead. 

What is the expected output? What do you see instead?
A FacebookType with an ID / The video published...
I see instead:
com.restfb.FacebookNetworkException: A network error occurred while trying to 
communicate with Facebook: Facebook POST failed (HTTP status code 400)

What version of the product are you using? On what operating system?
1.5.3 / Windows XP

Original issue reported on code.google.com by testbot....@gmail.com on 24 Aug 2010 at 1:22

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
1.6.5?

Original comment by collins....@gmail.com on 12 Jul 2011 at 4:41

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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