I am trying to integrate LinkedIn into my java web application but I am getting following exception when I tried to fetch the Person object from linkedin. The process of autherization/login/getting accesstoken is working fine and successfully. But while accessing linkedin object I am facing some issue.
Following is the code snippet:
LinkedInRequestToken requestToken = (LinkedInRequestToken) req.getSession().getAttribute("requestToken");
LinkedInOAuthService oauthService = LinkedInOAuthServiceFactory.getInstance().createLinkedInOAuthService(appkey, secretKey);
LinkedInAccessToken accessToken = oauthService.getOAuthAccessToken(requestToken, oauth_verifier);
LinkedInApiClientFactory factory = LinkedInApiClientFactory.newInstance(appId, secretKey);
LinkedInApiClient client = factory.createLinkedInApiClient(accessToken.getToken(), accessToken.getTokenSecret());
till code works fine but when I say,
Person person = client.getProfileForCurrentUser();
I am getting this exception:
com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
Package "com.google.code.linkedinapi.schema" is missing jaxb.properties file.
Have you copied this from the generated source directory or include it in the classpath?
this problem is related to the following location:
at com.google.code.linkedinapi.schema.ObjectFactory
I am using following dependecy for LinkedIn APIs
<dependency>
<groupId>com.googlecode.linkedin-j</groupId>
<artifactId>linkedin-j-core</artifactId>
<version>1.0.416</version>
</dependency>