Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inability to load sdk.properties leads to NPE instead of "Unknown" #435

Open
andrejusc opened this issue Aug 30, 2022 · 1 comment
Open
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@andrejusc
Copy link

This was initially observed for OCI Java SDK v2.30.0, but looking at code for v2.41.1 it could still happen in this class and line:
https://github.com/oracle/oci-java-sdk/blob/v2.41.1/bmc-common/src/main/java/com/oracle/bmc/ClientRuntime.java#L93
i.e. this one:

propertyStream.close();

as if sdk.properties resource is not found within Jar/classpath/etc. - then stream will be null and trying to close it will result in exception, which is not captured, like such:

java.lang.NullPointerException: inStream parameter is null
	at [email protected]/java.util.Objects.requireNonNull(Objects.java:233)
	at [email protected]/java.util.Properties.load(Properties.java:407)
	at [email protected]/com.oracle.bmc.ClientRuntime.sdkVersion(ClientRuntime.java:88)
@KartikShrikantHegde KartikShrikantHegde added the SDK Issue pertains to the SDK itself and not specific to any service label Sep 13, 2022
@KartikShrikantHegde
Copy link

Hello,

Our team will take a look and get back to you. Thanks for reporting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

2 participants