我使用Spring Social时遇到问题,当我尝试登录Facebook时,出现以下错误:
org.springframework.social.facebook.api.User["video_upload_limits"]->org.springframework.social.facebook.api.VideoUploadLimits["size"])
com.fasterxml.jackson.databind.JsonMappingException: Numeric value (2505397589) out of range of int
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助.
maven依赖:
春季4.2.0.RELEASE
<!-- Spring Social -->
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-core</artifactId>
<version>1.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-web</artifactId>
<version>1.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<!-- jason -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.6.2</version>
</dependency>
==> same error when version up to 2.7.0-rc1(jackson)
Run Code Online (Sandbox Code Playgroud)
代码:
String authorizationCode = request.getParameter("code");
FacebookConnectionFactory connectionFactory = new FacebookConnectionFactory(this.appId, this.appSecret);
OAuth2Operations oauthOperations = connectionFactory.getOAuthOperations();
AccessGrant accessGrant = oauthOperations.exchangeForAccess(authorizationCode, RequestUtil.getRedirectionURLForSNSSignUp(request, …Run Code Online (Sandbox Code Playgroud) 我使用spring-social-facebook与Graph API进行交互(1.0.3.RELEASE,如果它是metter).
我找不到任何操作来检索配置文件的图像网址.我发现只有返回字节数组的操作,它们对于实现来说不是很方便.
Spring Social中是否存在检索图像URL的任何操作?
如果没有,这有什么"整洁"的解决方法吗?
谢谢!
我是Spring Framework的初学者,并希望尝试使用Spring Social来创建一个简单的Web应用程序,从Facebook检索数据.为此我遵循了Spring Socials官方的" 入门指南 ",名为" 访问Facebook数据 ".
我遇到的第一个问题是Spring Social版本2.0.3.RELEASE,它似乎是Spring Social的最新官方版本,不支持facebook API的2.8版本(因此给出了以下错误:" (# 12)对于版本v2.8及更高版本,不推荐使用bio field.正如我昨天在developers.facebook.com上创建了Facebook应用程序,似乎我无法访问以前的API版本.
我用谷歌搜索了一个解决方案,发现版本3.0.0.M1似乎在maven存储库中可用,这应该可以解决这个问题.但是,当我更改.pom文件中的配置以使用此版本时,编译器无法再找到类ConnectionRepository.实际上整个包org.springframework.social.connect似乎都缺失了.
我从指南(https://spring.io/guides/gs/accessing-facebook/)复制的代码如下所示:
import org.springframework.social.connect.ConnectionRepository;
import org.springframework.social.facebook.api.Facebook;
import org.springframework.social.facebook.api.PagedList;
import org.springframework.social.facebook.api.Post;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/")
public class HelloController {
private Facebook facebook;
private ConnectionRepository connectionRepository;
public HelloController(Facebook facebook, ConnectionRepository connectionRepository) {
this.facebook = facebook;
this.connectionRepository = connectionRepository;
}
@GetMapping
public String helloFacebook(Model model) {
if (connectionRepository.findPrimaryConnection(Facebook.class) == null) { …Run Code Online (Sandbox Code Playgroud) spring facebook-graph-api spring-social spring-social-facebook facebook-graph-api-v2.8