大家好,我正在研究 twitter API twitter4j。我想通过我的 java 代码在我的 twitter 帐户上发送 Twitt,但是当我尝试编译它时,我得到了一些我不理解我的 java 代码的错误
public class entry {
public static void main(String ar[])throws TwitterException, IOException
{
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true);
cb.setOAuthConsumerKey("dJGC64ozxFNfs7D3LK07oA");
cb.setOAuthConsumerSecret("ExvnfE8AOM5vjqdjANoRdZyLKSOo2LZyHnxo2ERWzOs");
cb .setOAuthAccessToken("*****************************");
cb.setOAuthAccessTokenSecret("**************************");
Twitter tf=new TwitterFactory(cb.build()).getInstance();
tf.updateStatus("test ! ");
}
}
当我尝试编译我的代码时遇到的错误:
Exception in thread "main" A JSONObject text must begin with '{' found:
at 2 [character 3 line 1]
Relevant discussions can be found on the Internet at:
http://www.google.co.jp/search?q=6f994c35 or
TwitterException{exceptionCode=[6f994c35-006e990b 1b2aeabf-9f2c6cb7], statusCode=-1, message=null, code=-1, retryAfter=-1, rateLimitStatus=null, version=3.0.3}
at twitter4j.internal.http.HttpResponse.asJSONObject(HttpResponse.java:153)
at twitter4j.internal.json.StatusJSONImpl.<init>(StatusJSONImpl.java:66)
at twitter4j.internal.json.z_T4JInternalJSONImplFactory.createStatus(z_T4JInternalJSONImplFactory.java:69)
at twitter4j.TwitterImpl.updateStatus(TwitterImpl.java:241)
at twiterapplication.entry.main(entry.java:29)
Caused by: twitter4j.internal.org.json.JSONException: A JSONObject text must begin with '{' found:
http://www.google.co.jp/search?q=006e990b