gpt4 book ai didi

api - twitter4j getOAuthRequestToken错误

转载 作者:太空宇宙 更新时间:2023-11-03 13:07:54 25 4
gpt4 key购买 nike

故障排除谢谢

我不确定为什么不这样做。

也许https问题。

ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true).setOAuthConsumerKey("***************************")
.setOAuthConsumerSecret("***************************");

TwitterFactory tf = new TwitterFactory(cb.build());
Twitter twitter = tf.getInstance();
request.getSession().setAttribute("twitter",twitter);


g_reqToken = twitter.getOAuthRequestToken(); `<------------------error line`

authUrl = g_reqToken.getAuthorizationURL();

request.getSession().setAttribute("userToken",g_reqToken.getToken());

request.getSession().setAttribute("userSecretToken",g_reqToken.getTokenSecret());


调试[http-bio-80-exec-6](AbstractHandlerExceptionResolver.java:132)-从处理程序[web.controller.snsTest@33a5d1ee]中解决异常:api.twitter.com
    有关讨论可以在Internet上找到:
            http:/ /www.google.co.jp/search?q=3cc69290或
            http:/ /www.google.co.jp/search?q=161493db
    TwitterException {exceptionCode = [3cc69290-161493db 3cc69290-161493b1],statusCode = -1,消息=空,代码= -1,retryAfter = -1,rateLimitStatus =空,版本= 4.0.2}
    调试[http-bio-80-exec-6](AbstractHandlerExceptionResolver.java:132)-从处理程序[web.controller.snsTest@33a5d1ee]中解决异常:api.twitter.com
    有关讨论可以在Internet上找到:
            http:/ /www.google.co.jp/search?q=3cc69290或
            http:/ /www.google.co.jp/search?q=161493db
    TwitterException {exceptionCode = [3cc69290-161493db 3cc69290-161493b1],statusCode = -1,消息=空,代码= -1,retryAfter = -1,rateLimitStatus =空,版本= 4.0.2}
    调试[http-bio-80-exec-6](AbstractHandlerExceptionResolver.java:132)-从处理程序[web.controller.snsTest@33a5d1ee]中解决异常:api.twitter.com
    有关讨论可以在Internet上找到:
             http://www.google.co.jp/search?q=3cc69290
             http://www.google.co.jp/search?q=161493db
    TwitterException {exceptionCode = [3cc69290-161493db 3cc69290-161493b1],statusCode = -1,消息=空,代码= -1,retryAfter = -1,rateLimitStatus =空,版本= 4.0.2}
    DEBUG [http-bio-80-exec-6](FrameworkServlet.java:959)-无法完成请求
    api.twitter.com
    有关讨论可以在Internet上找到:
            http:/ /www.google.co.jp/search?q=3cc69290或
            http:/ /www.google.co.jp/search?q=161493db
    TwitterException {exceptionCode = [3cc69290-161493db 3cc69290-161493b1],statusCode = -1,消息=空,代码= -1,retryAfter = -1,rateLimitStatus =空,版本= 4.0.2}
            在twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:178)
            在twitter4j.HttpClientBase.request(HttpClientBase.java:53)
            在twitter4j.HttpClientBase.post(HttpClientBase.java:82)
            在twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.java:107)
            在twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.java:92)
            在twitter4j.TwitterBaseImpl.getOAuthRequestToken(TwitterBaseImpl.java:263)
            在twitter4j.TwitterBaseImpl.getOAuthRequestToken(TwitterBaseImpl.java:258)
            在web.controller.snsTest.twitter(snsTest.java:96)
            在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处
            在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            在java.lang.reflect.Method.invoke(Method.java:606)
            在org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
            在org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
            在org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)处
            在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
            在org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
            在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
            在org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
            在javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
            在org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
            在javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
            在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
            在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
            在org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
            在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
            在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
            在cms.common.SimpleCORSFilter.doFilter(SimpleCORSFilter.java:19)
            在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
            在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
            在org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
            在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
            在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
            在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
            在org.apache.logging.log4j.core.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:66)
            在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
            在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
            在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
            在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
            在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
            在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
            在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
            在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
            在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
            在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
            在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
            在org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:611)
            在org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:314)
            在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)
            在org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)
            在java.lang.Thread.run(Thread.java:745)
    造成原因:java.net.UnknownHostException:api.twitter.com
            在java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
            在java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
            在java.net.Socket.connect(Socket.java:579)
            在sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
            在sun.net.NetworkClient.doConnect(NetworkClient.java:175)
            在sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
            在sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
            在sun.net.www.protocol.https.HttpsClient。(HttpsClient.java:275)
            在sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
            在sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
            在sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
            在sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
            在sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1091)
            在sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
            在twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:136)
            ...另外51个

最佳答案

我遇到了同样的错误,但是当我切换到wifi时,一切都按预期工作了……网络连接一周后,我在twitter4j上遇到了类似的问题。

关于api - twitter4j getOAuthRequestToken错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26351460/

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