Over the past week or so, I have been exploring RestFB, with little success.
I downloaded RestFB 1.6.14 and have been working with that.
I have been able to compile the code, and, after reading the instructions a couple of times, found the examples.
However, as is in the instructions, I saw that I needed an Access Token.
Before I got that, I tried making a copy of the Reader Example, removing the Access Token parameter. No success. In general, the errors that I am seeing are something like: "User not logged in."
I then went back did two things. At first, I created a new Application, but that didn't seem right. After re-reading the instructions, I went to the FB Graph API section, and obtained an Access Token from there.
However, the response here is, as always, unsuccesful.
When I try running ant-reader-example with the very long Access Token string, I get:
ant run-reader-examples "-Daccess_token=CAAC ... very long Access Token string ... AZDZD"
Buildfile: /home/bdmc/projects/restfb-1.6.14/source/example/build.xml
compile:
[echo] Compiling examples...
[javac] /home/bdmc/projects/restfb-1.6.14/source/example/build.xml:28: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
run-reader-examples:
[java] * Fetching single objects *
[java] May 14, 2014 11:40:20 PM com.restfb.DefaultWebRequestor executeGet
[java] FINE: Making a GET request to
https://graph.facebook.com /me?access_token=CAACE ... very long Access Token string ... AZDZD&format=json
[java] May 14, 2014 11:40:21 PM com.restfb.DefaultWebRequestor executeGet
[java] FINE: Facebook responded with HTTP status code 400 and response body: {"error":{"message":"Error validating access token: The session is invalid because the user logged out.","type":"OAuthException","code":190,"error_subcode":467}}
[java] Exception in thread "main" com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: Error validating access token: The session is invalid because the user logged out. (code 190, subcode 467)
[java] at com.restfb.DefaultFacebookClient$DefaultGraphFacebookExceptionMapper.exceptionForTypeAndMessage(DefaultFacebookClient.java:964)
[java] at com.restfb.DefaultFacebookClient.throwFacebookResponseStatusExceptionIfNecessary(DefaultFacebookClient.java:885)
[java] at com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:824)
[java] at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:765)
[java] at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:729)
[java] at com.restfb.DefaultFacebookClient.fetchObject(DefaultFacebookClient.java:306)
[java] at com.restfb.example.GraphReaderExample.fetchObject(GraphReaderExample.java:101)
[java] at com.restfb.example.GraphReaderExample.runEverything(GraphReaderExample.java:83)
This is done at a command line, in a Ubuntu 13.10 system, running Java version "1.7.0_15"
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
Any suggestions, or anything that I can provide to help you guide me in the right direction?
Thank you,
Brian