Http://wenku.baidu.com/view/5a3ab0f9f90f76c661371afc.html
Development
NewLangMicroBoJAVA SDKOpenSending
The Java Development on the above page is illustrated in great detail. This article focuses on two areas that are prone to problems.
This is something that has not been mentioned in many documents or is not simply written. For your reference
As mentioned in this document, exceptions may occur when running oauth4code. Java, and the array subscript is out of bounds.
Exception in thread "Main" Java. Lang. arrayindexoutofboundsexception: 0
At weibo4j. Examples. oauth2.oauth4code. Main (oauth4code. Java: 14)
Solution: replace ARGs [0] And ARGs [1] with an empty string.
Barebonesbrowserlaunch. Openurl (oauth. Authorize ("code ","",""));
System. Out. println (oauth. Authorize ("code ","",""));
This will automatically call the data defined in config. properity, such as app_id
In the second place, when an accesstoken is obtained and a string starting with 2.0, you can use the token updatestatus. Java
To publish a microblog and test it. the following error may occur after authorization:
{"Error": "applications over the unaudited use restrictions! "," Error_code ": 21321," request ":"/2/statuses/update. JSON "}
Problem description: it is because sina verification is strict and only allows the current appkey user to test the application before the application is submitted for review during the test period. This error is reported when other users log on to the test.
Therefore, you can only use the user you applied for the appkey to log on to the test, or add a test account to the application you applied for. Now, you can add 15 test accounts to an application. After the application is completed, you can submit the application for review and use it.