从早上开始,我一直在努力了解如何在我的 webApp (Spring-MVC) 和 Spring-Social 之间实现登录功能。我正在使用 XML 配置,它似乎工作得很好。我在登录时遇到了麻烦,例如 twitter。我向您展示我的堆栈跟踪打印结果:
InvocableHandlerMethod - Invoking [signIn] method with arguments [twitter, ServletWebRequest: uri=/SitiPreventivi/signin/twitter;client=127.0.0.1;session=6EE8AE04F40C32C823646844BF36378B]
2013-01-12 18:21:16,168 DEBUG [http-bio-8080-exec-7] HttpAccessor - Created POST request for "https://api.twitter.com/oauth/request_token"
2013-01-12 18:21:16,169 DEBUG [http-bio-8080-exec-7] RestTemplate$AcceptHeaderRequestCallback - Setting request Accept header to [application/x-www-form-urlencoded, multipart/form-data]
2013-01-12 18:21:17,317 WARN [http-bio-8080-exec-7] RestTemplate - POST request for "https://api.twitter.com/oauth/request_token" resulted in 406 (Not Acceptable); invoking error handler
2013-01-12 18:21:17,326 DEBUG [http-bio-8080-exec-7] InvocableHandlerMethod - Method [signIn] returned [org.springframework.web.servlet.view.RedirectView: unnamed; URL [/signin?error=provider]]
2013-01-12 18:21:17,326 DEBUG [http-bio-8080-exec-7] DispatcherServlet - Rendering view [org.springframework.web.servlet.view.RedirectView: unnamed; URL [/signin?error=provider]] in DispatcherServlet with name 'SitiPreventivi Servlet'
2013-01-12 18:21:17,326 DEBUG [http-bio-8080-exec-7] AbstractView - Rendering view with name 'null' with model {} and static attributes {}
我只向您展示有关我的问题的相关部分。如您所见,发出了对正确 url 的发布请求,但我收到了 406 错误,我无法解释。有没有办法解决问题?
提前致谢。
克劳迪奥