Oracle Cloud Infrastructure Documentation

Troubleshooting

This section contains troubleshooting information for the Oracle Cloud Infrastructure SDK for Java.

ObjectStorage client does not close connections when client is closed.

Too many file descriptors are opened up, and it takes too long to close existing ones. An exception may look like this:

Caused by: java.io.FileNotFoundException: classes/caspertest.pem (Too many open files)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)

Use one of the following workarounds to fix this issue.

  • Make this call before creating a client: System.setProperty("http.keepAlive", "false");
  • Use this command line argument when running Java: -Dhttp.keepAlive=false

Serialization errors when making requests or handling responses

If you encounter an UnrecognizedPropertyException error when handling a response to a call against the SDK for Java, this indicates that the version of the Jackson library in use does not support a feature that was injected at runtime from another dependency in your application's class path. This happens even if the FAIL_ON_UNKNOWN_PROPERTIES deserialization property is set to false for the configured ObjectMapper.

Solution:

Determine which version of Jackson libraries are referenced in your application’s class path and, if necessary, upgrade to version 2.9.5. For a complete list of Jackson libraries that the SDK for Java depends on, please refer to the pom.xml file that is hosted on GitHub.

Note

If you customize a client when instantiated in your application, ensure that you reference the preconfigured ObjectMapperfrom the RestClientFactory using the RestClientFactory#getObjectMapper() method.

An alternative solution is to to use the shaded version of the SDK for Java jar file, which includes a bundled version of the Jackson libraries.

Encryption key size errors

By default, the SDK for Java can only handle keys of 128 bit or lower key length. Users get "Invalid Key Exception" and "Illegal key size" errors when they use longer keys, such as AES256.

Use one of the following workarounds to fix this issue.

Troubleshooting Service Errors

Any operation resulting in a service error will cause an exception of type com.oracle.bmc.model.BmcException to be thrown by the SDK. For information about common service errors returned by OCI, see API Errors.