Spring for social for android。故障

时间:2015-01-27 10:31:36

标签: android facebook spring-social

我正在使用spring social ver:

compile('org.springframework.android:spring-android-auth:1.0.1.RELEASE') {
    exclude group: 'org.springframework', module: 'spring-social-core'
}
compile('org.springframework.social:spring-social-facebook:1.1.1.RELEASE') {
}
compile('org.springframework.social:spring-social-twitter:1.1.0.RELEASE') {
}
compile('org.springframework.social:spring-social-linkedin:1.0.1.RELEASE') {
}
compile('org.springframework.social:spring-social-tumblr:1.1.0.M1') {
    exclude group: 'org.springframework.social', module: 'spring-social-config'

    exclude group: 'org.springframework.security', module: 'spring-security-core'
    exclude group: 'org.springframework.security', module: 'spring-security-web'
    exclude group: 'org.springframework.security', module: 'spring-security-crypto'

    exclude group: 'org.springframework', module: 'spring-tx'
    exclude group: 'org.springframework', module: 'spring-jdbc'
}

第一个问题,请解释我如何从facebook登录并登录其他用户并重新获取数据新用户。 因为在重新登录之后

getApi().userOperations().getUserProfile()

返回旧登录用户的数据。

第二个问题,当尝试解析facebook用户数据时出现春季社交抛出异常。

org.springframework.social.UncategorizedApiException: Error deserializing data from Facebook: Can not instantiate value of type [simple type, class org.springframework.social.facebook.api.Reference] from Integral number; no single-int-arg constructor/factory method (through reference chain: org.springframework.social.facebook.api.FacebookProfile["education"])
        at org.springframework.social.facebook.api.impl.FacebookTemplate.deserializeDataList(FacebookTemplate.java:338)
        at org.springframework.social.facebook.api.impl.FacebookTemplate.pagify(FacebookTemplate.java:242)
        at org.springframework.social.facebook.api.impl.FacebookTemplate.fetchConnections(FacebookTemplate.java:223)
        at org.springframework.social.facebook.api.impl.FriendTemplate.getFriendProfiles(FriendTemplate.java:135)
        at org.springframework.social.facebook.api.impl.FriendTemplate.getFriendProfiles(FriendTemplate.java:102)
        at com..fragment.ChooseModeFragment$2$1$1.onSuccess(ChooseModeFragment.java:154)
        at com.loopj.android.http.AsyncHttpResponseHandler.handleMessage(AsyncHttpResponseHandler.java:311)
        at com.loopj.android.http.AsyncHttpResponseHandler.sendMessage(AsyncHttpResponseHandler.java:358)
        at com.loopj.android.http.AsyncHttpResponseHandler.sendSuccessMessage(AsyncHttpResponseHandler.java:275)
        at com.loopj.android.http.AsyncHttpResponseHandler.sendResponseMessage(AsyncHttpResponseHandler.java:406)
        at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:165)
        at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:182)
        at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:109)
        at com.loopj.android.http.SyncHttpClient.sendRequest(SyncHttpClient.java:95)
        at com.loopj.android.http.AsyncHttpClient.post(AsyncHttpClient.java:944)
        at com..fragment.ChooseModeFragment$2$1.doInBackground(ChooseModeFragment.java:148)
        at android.os.AsyncTask$2.call(AsyncTask.java:288)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:818)
 Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class org.springframework.social.facebook.api.Reference] from Integral number; no single-int-arg constructor/factory method (through reference chain: org.springframework.social.facebook.api.FacebookProfile["education"])
        at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromInt(StdValueInstantiator.java:320)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromNumber(BeanDeserializerBase.java:1106)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:141)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:126)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:525)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:331)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1071)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:268)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:124)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:227)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:204)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:23)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty.d

VIDEO

0 个答案:

没有答案