huuanh1987 / facebook-java-api

Automatically exported from code.google.com/p/facebook-java-api
0 stars 0 forks source link

v=1.0 causing Invalid Paramater exception? #195

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a FacebookXmlRestClient client
2. Get a token with client.auth_createToken()
3. Try to call client.auth_getSession(token).

My source:

        FacebookXmlRestClient client = new FacebookXmlRestClient("hidden", "hidden");
        logger.info("Made client " + client);
        try {
            String token = client.auth_createToken();
            logger.info("token: " + token);
            String session = client.auth_getSession(token);
            logger.info("session: " + session);
            client.friends_get();
        } catch (FacebookException e) {
            logger.log(Level.SEVERE, "FacebookException - " + e.getMessage(), e);
            return;
        }

What is the expected output? What do you see instead?

I see an exception thrown in the call to auth_getSession():
com.google.code.facebookapi.FacebookException: Invalid parameter
    at
com.google.code.facebookapi.FacebookXmlRestClient.parseCallResult(FacebookXmlRes
tClient.java:217)
    at
com.google.code.facebookapi.FacebookXmlRestClient.parseCallResult(FacebookXmlRes
tClient.java:72)
    at
com.google.code.facebookapi.ExtensibleClient.callMethod(ExtensibleClient.java:53
1)
    at
com.google.code.facebookapi.ExtensibleClient.callMethod(ExtensibleClient.java:46
7)
    at
com.google.code.facebookapi.FacebookXmlRestClient.auth_getSession(FacebookXmlRes
tClient.java:192)
    at ltd.yavin.liveauction.test.FacebookTest.main(FacebookTest.java:23)

What version of the product are you using? On what operating system?

facebook-java-api-2.1.0.jar on Linux (Centos 5.3, very up to date)

Please provide any additional information below.

I've created a new Facebook app id and am trying to use these libs for the
first time.  A thread here seems to point to the 'v=' param being passed by
your library being incorrect, it should be 'version=':

http://markmail.org/message/dkscta3pspjgczmc#query:auth_getSession%20%22Invalid%
20parameter%22+page:1+mid:xseh3aufd3lsxchj+state:results

Wireshark shows me the string sent by your library includes "&v=1.0" and
the source download seems to have a 'v' being set in ExtensibleClient.

I don't have Maven set up so building your source is quite a pain for me
right now.

Am I doing something silly or is this really a simple facebook api change
bug?  Thanks :)

Original issue reported on code.google.com by neekfenw...@gmail.com on 26 Apr 2009 at 9:41

GoogleCodeExporter commented 8 years ago
Most probably your Web / Desktop setting. I've added an entry for this to:

http://code.google.com/p/facebook-java-api/wiki/FAQ

Original comment by david.j....@googlemail.com on 1 May 2009 at 9:09

GoogleCodeExporter commented 8 years ago
Thanks David, you were right, my App was on the default 'Web' application type. 
That's a very useful FAQ entry for beginners.

I've changed my app to Desktop.  However, an hour after making the change on the
facebook site, I'm still getting 'Invalid parameter' thrown.  I'll try again 
later.

I had got Maven and rebuilt the library with 'version' instead of 'v', but that
didn't help, so I've gone back to the 2.1.0 release of facebook-java-api.

Original comment by neekfenw...@gmail.com on 7 May 2009 at 6:05

GoogleCodeExporter commented 8 years ago
Hi all,
I get the issue too.
I have set my app to Desktop mode. but I still get "Invalid parameter
" error message.
who can help? thanks.

Original comment by thanh.ki...@gmail.com on 19 Jun 2009 at 10:34

GoogleCodeExporter commented 8 years ago
I am also getting this issue. I have also change my application to Desktop but 
to no 
avail. Even the unit test Issue161FriendsGetSessionless throws this exception:
com.google.code.facebookapi.FacebookException: Invalid parameter
    at com.google.code.facebookapi.FacebookJsonRestClient.parseCallResult
(FacebookJsonRestClient.java:351)
    at com.google.code.facebookapi.ExtensibleClient.callMethod
(ExtensibleClient.java:531)
    at com.google.code.facebookapi.ExtensibleClient.callMethod
(ExtensibleClient.java:467)
    at com.google.code.facebookapi.FacebookJsonRestClient.auth_getSession
(FacebookJsonRestClient.java:275)

I am using API version 2.1.1. 

Please let us know whats the solution if any.

Thank you very much.

Original comment by nabeelmukhtar on 23 Jun 2009 at 2:45

GoogleCodeExporter commented 8 years ago
I do not see any solution here. Where can I get the answer

Original comment by lakh...@gmail.com on 1 Dec 2009 at 1:35