【发布时间】:2013-12-18 10:32:46
【问题描述】:
我正在尝试将 LinkedIn 集成到我的 Java Web 应用程序中,但是当我尝试从 linkedin 获取 Person 对象时出现以下异常。 授权/登录/获取访问令牌的过程运行良好且成功。 但是在访问linkedin对象时我遇到了一些问题。
下面是sn-p的代码:
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());
直到代码工作正常,但是当我说,
Person person = client.getProfileForCurrentUser();
我遇到了这个异常:
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
我正在为 LinkedIn API 使用以下依赖项
<dependency>
<groupId>com.googlecode.linkedin-j</groupId>
<artifactId>linkedin-j-core</artifactId>
<version>1.0.416</version>
</dependency>
【问题讨论】:
标签: java annotations linkedin linkedin-j