Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

User Profile Full : error org.springframework.social.UncategorizedApiException #72

Open
fritzZz opened this issue Jan 17, 2018 · 4 comments

Comments

@fritzZz
Copy link

fritzZz commented Jan 17, 2018

Hi all,

I'm using the version 1.0.2.RELEASE of this library and in the last days when I call the API

linkedin.profileOperations().getUserProfileFull()

I got this error :

ERROR [com.fluttr.site.controllers.signin.SigninControllerWebSite] (default task-26) Throwable full profile: org.springframework.social.UncategorizedApiException: at org.springframework.social.linkedin.api.impl.LinkedInErrorHandler.handleUncategorizedError(LinkedInErrorHandler.java:62) [spring-social-linkedin-1.0.2.RELEASE.jar:1.0.2.RELEASE] at org.springframework.social.linkedin.api.impl.LinkedInErrorHandler.handleError(LinkedInErrorHandler.java:55) [spring-social-linkedin-1.0.2.RELEASE.jar:1.0.2.RELEASE] at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:616) [spring-web-4.1.9.RELEASE.jar:4.1.9.RELEASE] at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:572) [spring-web-4.1.9.RELEASE.jar:4.1.9.RELEASE] at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:547) [spring-web-4.1.9.RELEASE.jar:4.1.9.RELEASE] at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:255) [spring-web-4.1.9.RELEASE.jar:4.1.9.RELEASE] at org.springframework.social.linkedin.api.impl.ProfileTemplate.getUserProfile(ProfileTemplate.java:123) [spring-social-linkedin-1.0.2.RELEASE.jar:1.0.2.RELEASE] at org.springframework.social.linkedin.api.impl.ProfileTemplate.getUserProfileFull(ProfileTemplate.java:92) [spring-social-linkedin-1.0.2.RELEASE.jar:1.0.2.RELEASE]

Maybe something in the Linkedin Api has been changed, I want to know if there is any way to avoid this kind of errors during response parsing.

Thank you

@imod
Copy link

imod commented Jan 22, 2018

@habuma I found the issue causing this...
the call linkedin.profileOperations().getUserProfileFull() asks for the field current-share if I remove this from the API call, then the request works again.

This is a working call (I removed current-share):
https://api.linkedin.com/v1/people/~:(id,first-name,last-name,headline,location,industry,distance,relation-to-viewer,num-connections,num-connections-capped,summary,specialties,proposal-comments,associations,honors,interests,positions,publications,patents,languages,skills,certifications,educations,three-current-positions,three-past-positions,num-recommenders,recommendations-received,phone-numbers,im-accounts,twitter-accounts,date-of-birth,main-address,member-url-resources,picture-url,site-standard-profile-request:(url),api-public-profile-request:(url),site-public-profile-request:(url),api-standard-profile-request,public-profile-url,email-address)?format=json

I have no idea why... the field is still listed in the list of fields for basic-profile: https://developer.linkedin.com/docs/fields/basic-profile

@imod
Copy link

imod commented Jan 23, 2018

btw. just to get it work again, I did a custom build for us. The only change I made was this: yooture@b2cdc94
...I don't think/know this is the correct fix for the whole library, but as we don't care about the value of this field anyway, so this is good enough.

@fritzZz
Copy link
Author

fritzZz commented Jan 29, 2018

Thank you! I need a suggestion!
How can I use your bugfix?
Asking for a new release or building your code and import the jar as a local library?
I use to work with maven!

@imod
Copy link

imod commented Jan 30, 2018

a fix by the maintainers of this library would be the perfect solution, but unfortunate spring-social-linkedin seems not to have a lot of love lately...
If you want, you can just do a build of this branch and be done for now: https://github.com/yooture/spring-social-linkedin/tree/remove_current-share
just be aware, this just fixes the current issue with the UncategorizedApiException when calling .getUserProfileFull() - we don't need a lot of the other functionality and therefore I have no idea if there are any other things it brakes. For us, this is good enough for now, not sure about your use case....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants