gpt4 book ai didi

java - Twitter + Scribe + 无法从空对象获取字符串

转载 作者:行者123 更新时间:2023-11-30 04:02:50 25 4
gpt4 key购买 nike

我正在尝试使用 scribe 进行 Twitter 授权。当我尝试时

requestToken = service.getRequestToken()

我收到以下错误

14:10:11,305 ERROR [ajp-bio-8009-exec-4][IncludeTag:154]   java.lang.IllegalArgumentException: Cannot get String from a null object
at org.scribe.utils.Preconditions.check(Preconditions.java:80)
at org.scribe.utils.Preconditions.checkNotNull(Preconditions.java:27)
at org.scribe.utils.StreamUtils.getStreamContents(StreamUtils.java:20)
at org.scribe.model.Response.parseBodyContents(Response.java:40)
at org.scribe.model.Response.getBody(Response.java:66)
at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:59)
at org.apache.jsp.html.portlet.login.login_jsp._jspService(login_jsp.java:2432)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

我尝试了以下帖子中提到的答案,但没有任何效果

<强> scribe + twitter > Cannot get String from a null object

每当我尝试包含 TwitterApi.SSL.class 或 TwitterApi.Authenticate.class 时,都会出现“无法解析为类型”错误。

有人遇到过这个问题吗?

最佳答案

使用 .provider(TwitterApi.SSL.class) 代替 .provider(TwitterApi.class)。它应该可以工作。

关于java - Twitter + Scribe + 无法从空对象获取字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21529630/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com