问题
Can u just tell me what this error is associated with..?Iam getting this error each time while sharing my content into Twitter....
08-27 17:13:50.966: D/error dj-->(2469): 403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (http://support.twitter.com/forums/10711/entries/15364).
08-27 17:13:50.966: D/error dj-->(2469): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
08-27 17:13:50.966: D/error dj-->(2469): <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
08-27 17:13:50.966: D/error dj-->(2469): <TITLE>ERROR: The requested URL could not be retrieved</TITLE>
08-27 17:13:50.966: D/error dj-->(2469): <STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
08-27 17:13:50.966: D/error dj-->(2469): <H1>ERROR</H1>
08-27 17:13:50.966: D/error dj-->(2469): <H2>The requested URL could not be retrieved</H2>
08-27 17:13:50.966: D/error dj-->(2469): <HR noshade size="1px">
08-27 17:13:50.966: D/error dj-->(2469): <P>
08-27 17:13:50.966: D/error dj-->(2469): While trying to retrieve the URL:
08-27 17:13:50.966: D/error dj-->(2469): <A HREF="http://api.twitter.com/1/statuses/update.json">http://api.twitter.com/1/statuses/update.json</A>
08-27 17:13:50.966: D/error dj-->(2469): <P>
08-27 17:13:50.966: D/error dj-->(2469): The following error was encountered:
08-27 17:13:50.966: D/error dj-->(2469): <UL>
08-27 17:13:50.966: D/error dj-->(2469): <LI>
08-27 17:13:50.966: D/error dj-->(2469): <STRONG>
08-27 17:13:50.966: D/error dj-->(2469): Access Denied.
08-27 17:13:50.966: D/error dj-->(2469): </STRONG>
08-27 17:13:50.966: D/error dj-->(2469): <P>
08-27 17:13:50.966: D/error dj-->(2469): Access control configuration prevents your request from
08-27 17:13:50.966: D/error dj-->(2469): being allowed at this time. Please contact your service provider if
08-27 17:13:50.966: D/error dj-->(2469): you feel this is incorrect.
08-27 17:13:50.966: D/error dj-->(2469): </UL>
08-27 17:13:50.966: D/error dj-->(2469): <P>Your cache administrator is <A HREF="mailto:admin@localhost">admin@localhost</A>.
08-27 17:13:50.966: D/error dj-->(2469): <BR clear="all">
08-27 17:13:50.966: D/error dj-->(2469): <HR noshade size="1px">
08-27 17:13:50.966: D/error dj-->(2469): <ADDRESS>
08-27 17:13:50.966: D/error dj-->(2469): Generated Tue, 27 Aug 2013 11:43:51 GMT by localhost (squid/2.7.STABLE9)
08-27 17:13:50.966: D/error dj-->(2469): </ADDRESS>
08-27 17:13:50.966: D/error dj-->(2469): </BODY></HTML>
回答1:
You are using a deprecated web service of Twitter,
http://api.twitter.com/1/statuses/update.json
This represents version 1 of the REST services, but to my knowledge Twitter is updated to 1.1.
You should change the twitter 4j library to version 3.0.3
回答2:
try this example it is working for me TWITTER EXAMPLE and change your consumer_key
and secret_key
we modified values.
public final String consumer_key = "Replace your KEY";
public final String secret_key = "Replace your KEY";
And this one also working fine Another Example
use latest libraries
twitter4j-media-support-3.0.3.jar
,twitter4j-core-3.0.3.jar
来源:https://stackoverflow.com/questions/18464670/twitter-error-while-sharing