Results 1 to 6 of 6

Thread: Error when get user profile (facebook), but success when update status

  1. #1
    Join Date
    Jun 2011
    Posts
    6

    Default Error when get user profile (facebook), but success when update status

    Hi all.. I want to ask, why i've got error when trying to retrieve user profile.
    I have successfully login to facebook and update status to facebook, but when i'm trying to get user's profile data, i've got error...

    Please help me to get user's profile data..

    Here is the code :
    Code:
    @RequestMapping(value = "/memberArea", method = RequestMethod.GET)
    public ModelMap getData(@RequestParam(value = "code", required = true) String code)
    {
            ModelMap m = new ModelMap();
            String accessToken = fBStuffKeeper.retrieveAccessToken(code);
            //FacebookTemplate fbTemplate = new FacebookTemplate(accessToken);
            FacebookApi fbApi = new FacebookTemplate(accessToken);
            
            System.out.println("success create object fbApi : " + fbApi);
            try
            {
                //fbTemplate.feedOperations().updateStatus("test update status via spring social");
                fbApi.feedOperations().updateStatus("test update status via spring social");
                System.out.println("success update status);
    
                FacebookProfile fbProfile = fbApi.userOperations().getUserProfile(); // error in here
                
                System.out.println("profile image : "  + fbApi.userOperations().getUserProfileImage()); //it works
                            
                System.out.println("success");
            }
            catch(Throwable e)
            {
                System.out.println(" error : " + e.getMessage());
            }
    
            return m;     
        }
    error that appear in tomcat like this :
    14:00:15.515 [http-8084-22] DEBUG o.s.web.client.RestTemplate - Reading [org.springframework.social.facebook.api.FacebookPr ofile] as "application/json" using [org.springframework.http.converter.json.MappingJac ksonHttpMessageConverter@1727f34]
    error : Unexpected graph API exception
    what should i do?
    in spring-social-reference.pdf, the code is FacebookProfile profile = facebookApi.userOperations().getUserProfile();
    but it doesn't works..

    FYI, I am using spring-social-1.0.0.M3

    thx b4...
    Last edited by yehezqiel; Jun 17th, 2011 at 03:34 AM.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,099

    Default

    Since you're using 1.0.0.M3, odds are that your profile has information in it that is neither being handled or ignored by the JSON processing. This was a known bug in M3, but has been fixed and is available in the snapshot builds.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Jun 2011
    Posts
    6

    Default

    Quote Originally Posted by habuma View Post
    Since you're using 1.0.0.M3, odds are that your profile has information in it that is neither being handled or ignored by the JSON processing. This was a known bug in M3, but has been fixed and is available in the snapshot builds.
    thx for your response..
    but i'm still don't understand..

    Did you mean that i must download the newest jar in : https://s3browse.springsource.com/br...UILD-SNAPSHOT/
    I've try to download, buat it can't be used..

    Can you teach me how to solve that bug in M3..
    thx..

  4. #4
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Please see the ref docs on how to obtain snapshot builds using a dependency manager like Maven. If you're not using something like Maven, you'll have to get the jars and add them to your project yourself. The latest snapshot is pretty much what will be the RC1 release so I suggest working against that at this point rather than M3.
    Keith Donald
    Core Spring Development Team

  5. #5
    Join Date
    Jun 2011
    Posts
    6

    Default

    Quote Originally Posted by Keith Donald View Post
    Please see the ref docs on how to obtain snapshot builds using a dependency manager like Maven. If you're not using something like Maven, you'll have to get the jars and add them to your project yourself. The latest snapshot is pretty much what will be the RC1 release so I suggest working against that at this point rather than M3.
    thx.. but finally, i'm using spring-social-1.0.0.M2..

    I want to ask again..
    spring social doesn't provide a function to sign out from facebook, doesn't it?
    thx..

  6. #6
    Join Date
    Aug 2004
    Posts
    1,099

    Default

    ConnectController does support the removal of a local connection from Facebook. But Spring Social does not support signing out of Facebook itself.
    Craig Walls
    Spring Social Project Lead

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •