Methods
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference
If problems occur when using the OBS Java SDK, you can perform the following steps to analyze and locate the problems.
- Make sure that the latest version of OBS Java SDK is used. Click here to download the latest version.
- Make sure that the logging function of OBS Java SDK is enabled. For details about how to enable the function, see the Log Analysis section. The recommended log level is WARN.
- Make sure that the program code of the OBS Java SDK complies with General Examples of ObsClient. All ObsClient APIs are processed with exception handling. The following is an example code of uploading an object:
ObsClient obsClient = null; try { String endPoint = "https://your-endpoint"; String ak = "*** Provide your Access Key ***"; String sk = "*** Provide your Secret Key ***"; obsClient = new ObsClient(ak, sk, endPoint); HeaderResponse response = obsClient.putObject("bucketname", "objectname", new ByteArrayInputStream("Hello OBS".getBytes())); // Optional: After the API is successfully called, record the HTTP status code and request ID returned by the server. System.out.println(response.getStatusCode()); System.out.println(response.getRequestId()); } catch (ObsException e) { // Recommended: When an exception occurs, record the HTTP status code, server-side error code, and request ID returned by the server. System.out.println("HTTP Code: " + e.getResponseCode()); System.out.println("Error Code:" + e.getErrorCode()); System.out.println("Request ID:" + e.getErrorRequestId()); // Recommended: When an exception occurs, record the stack information. e.printStackTrace(System.out); } - If an exception occurs when an ObsClient API is called, obtain the HTTP status code and OBS server-side error code from ObsException or log file, and compare them to locate the exception cause.
- If the exception cause cannot be found in step 4, obtain the request ID returned by the OBS server from ObsException or log file and contact the OBS server O&M team to locate the cause.
- If the request ID is unable to be obtained, collect the stack information of ObsException and contact the OBS client O&M team to locate the cause.
Last Article: Fault Locating
Next Article: Resolving Dependency Missing and Dependency Conflict

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.