Announcement Announcement Module
Collapse
No announcement yet.
Error when get user profile (facebook), but success when update status Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 04:34 AM.

  • #2
    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.

    Comment


    • #3
      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..

      Comment


      • #4
        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.

        Comment


        • #5
          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..

          Comment


          • #6
            ConnectController does support the removal of a local connection from Facebook. But Spring Social does not support signing out of Facebook itself.

            Comment

            Working...
            X