huuanh1987 / facebook-java-api

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

Retrieving application properties produces an exception #230

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a FacebookJaxbRestClient using an api key and app secrect and no
session
2. Call admin_getAppPropertiesMap ( EnumSet.of(
ApplicationProperty.CANVAS_NAME ) )

I expected a map to be returned but instead an exception is thrown.

I originally encountered the problem in 2.1.1, but wrote a test case
against 3.0.0.

The attached test case uses the "lib" directory in an unpacked 3.0.0
snapshot. But... I had to copy my own version of commons-lang.jar into
there in order to satisfy jaxb. I am not familiar with the build process
for the facebook api, so I suppose it is possible that my commons-lang.jar
is the wrong version but I don't know how to tell.

I also noticed that the source code from trunk did not seem to match the
binaries in 3.0.0. For example, the failing method is in
SpecificReturnTypeAdapter in the binaries but I don't see this in the
read-only trunk source. So perhaps this is fixed and there is a build error.

To run the test case
1. unpack as a sibling of the facebook-3.0.0-SNAPSHOT directory
2. cd into the unpacked folder
3. ./run.sh with your api key and app secret as arguments

Original issue reported on code.google.com by jamie.doornbos on 3 Aug 2009 at 6:24

Attachments:

GoogleCodeExporter commented 8 years ago
I just tried this in 2.1.1 using the admin_getAppProperties method. The 
exception
thrown is a little more enlightening than the one I was getting before. It 
looks like
facebook is correctly returning my test application's canvas name, but both the 
key
and value of the map are within "s. Maybe this is a recent change from Facebook:

Exception in thread "main" com.google.code.facebookapi.FacebookException: 
Failed to
parse server response:  {"canvas_name":"jamies-home-whirled"}
    at
com.google.code.facebookapi.ExtensibleClient.admin_getAppProperties(ExtensibleCl
ient.java:2568)
    at Test.main(Test.java:23)

Original comment by jamie.doornbos on 3 Aug 2009 at 6:38

GoogleCodeExporter commented 8 years ago
um, please try again, i just re-wrote that method and it should be a lot more 
robust.

Original comment by fern...@gmail.com on 1 Nov 2009 at 12:58