rkmishracs / linkedin-j

Automatically exported from code.google.com/p/linkedin-j
0 stars 0 forks source link

LinkedInApiClientException: java.lang.IllegalArgumentException: MOBILE #125

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. connect with linkedin and get Access token and secret 
2. call method 

LinkedinDialog.factory = 
LinkedInApiClientFactory.newInstance(LINKEDIN_CONSUMER_KEY, 
LINKEDIN_CONSUMER_SECRET);
LinkedInAccessToken accessToken = new 
LinkedInAccessToken(ACCESS_TOKEN_LINKEDIN, TOKEN_SECRET_LINKEDIN);

LinkedInApiClient client = 
LinkedinDialog.factory.createLinkedInApiClient(accessToken);

if (client != null)
{
Network network = client.getUserUpdates(ID, 
EnumSet.of(NetworkUpdateType.CONNECTION_UPDATE, 
NetworkUpdateType.EXTENDED_PROFILE_UPDATE, NetworkUpdateType.GROUP_UPDATE, 
NetworkUpdateType.JOB_UPDATE, NetworkUpdateType.STATUS_UPDATE, 
NetworkUpdateType.SHARED_ITEM, NetworkUpdateType.COMPANY_FOLLOW_UPDATE, 
NetworkUpdateType.PICTURE_UPDATE, NetworkUpdateType.PROFILE_UPDATE));
}

Exception come on  client.getUserUpdates method.

Note: this exception is not coming for all linkedin Profile.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Release 1.0.429 Linkedin-j-android

Please provide any additional information below.

stack trace:

10-23 11:28:12.599: W/System.err(10604): 
com.google.code.linkedinapi.client.LinkedInApiClientException: 
java.lang.IllegalArgumentException: MOBILE
10-23 11:28:12.599: W/System.err(10604):    at 
com.google.code.linkedinapi.client.impl.LinkedInApiXppClient.unmarshallObject(Li
nkedInApiXppClient.java:119)
10-23 11:28:12.599: W/System.err(10604):    at 
com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.readResponse(BaseL
inkedInApiClient.java:1905)
10-23 11:28:12.599: W/System.err(10604):    at 
com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.getUserUpdates(Bas
eLinkedInApiClient.java:920)

and 

Caused by: java.lang.IllegalArgumentException: MOBILE
10-23 12:06:39.329: W/System.err(14746):    at 
com.google.code.linkedinapi.schema.PhoneType.fromValue(PhoneType.java:58)
10-23 12:06:39.329: W/System.err(14746):    at 
com.google.code.linkedinapi.schema.xpp.PhoneNumberImpl.init(PhoneNumberImpl.java
:64)
10-23 12:06:39.329: W/System.err(14746):    at 
com.google.code.linkedinapi.schema.xpp.PhoneNumbersImpl.init(PhoneNumbersImpl.ja
va:66)
10-23 12:06:39.329: W/System.err(14746):    at 
com.google.code.linkedinapi.schema.xpp.PersonImpl.init(PersonImpl.java:595)
10-23 12:06:39.329: W/System.err(14746):    at 
com.google.code.linkedinapi.schema.xpp.UpdateContentImpl.init(UpdateContentImpl.
java:138)
10-23 12:06:39.329: W/System.err(14746):    at 
com.google.code.linkedinapi.schema.xpp.UpdateImpl.init(UpdateImpl.java:155)
10-23 12:06:39.329: W/System.err(14746):    at 
com.google.code.linkedinapi.schema.xpp.UpdatesImpl.init(UpdatesImpl.java:89)
10-23 12:06:39.329: W/System.err(14746):    at 
com.google.code.linkedinapi.schema.xpp.NetworkImpl.init(NetworkImpl.java:71)
10-23 12:06:39.329: W/System.err(14746):    at 
com.google.code.linkedinapi.client.impl.LinkedInApiXppClient.unmarshallObject(Li
nkedInApiXppClient.java:163)

Original issue reported on code.google.com by srivasta...@gmail.com on 23 Oct 2012 at 6:45

GoogleCodeExporter commented 9 years ago
Same problem here. When some connection updates its phone number, the app 
crashes. To avoid this, i will have to make a generic request with all the 
update types and a specific one to get the Extended profile info.

If lucky, none of my connections will update the phone and i will be able to 
show the extended profile updates without breaking the entire logic.

Original comment by luis.fer...@gmail.com on 31 Oct 2013 at 6:27