You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the bug?
In the examples, the following code is given to illustrate using a custom AWSCredentialsProvider instance with the driver:
importjava.sql.Connection;
importjava.sql.DriverManager;
importjava.sql.Statement;
Stringurl = "jdbc:opensearch://https://remote-host-name";
Propertiesproperties = newProperties();
properties.put("awsCredentialsProvider", newEnvironmentVariableCredentialsProvider());
Connectioncon = DriverManager.getConnection(url, properties);
Statementst = con.createStatement();
// use the connection// close connectioncon.close();
However, in practice this causes a null pointer exception in the setProperties function of the org.opensearch.jdbc.config.ConnectionConfig.Builder class because the getProperty method is used, which returns null if the property value is not a string. If a string is specified instead, a org.opensearch.jdbc.config.ConnectionPropertyException exception is thrown because it's expecting an AWSCredentialsProvider instance and not a string.
How can one reproduce the bug?
Steps to reproduce the behavior:
Implement the custom AWSCredentialsProvider example
What is the expected behavior?
The AWSCredentialsProvider instance should be correctly passed through to the driver.
What is your host/environment?
OS: Manjaro Linux x86_64 (Kernel 6.1.71-1-MANJARO)
JDK: 11
The text was updated successfully, but these errors were encountered:
What is the bug?
In the examples, the following code is given to illustrate using a custom AWSCredentialsProvider instance with the driver:
However, in practice this causes a null pointer exception in the
setProperties
function of theorg.opensearch.jdbc.config.ConnectionConfig.Builder
class because thegetProperty
method is used, which returns null if the property value is not a string. If a string is specified instead, aorg.opensearch.jdbc.config.ConnectionPropertyException
exception is thrown because it's expecting an AWSCredentialsProvider instance and not a string.How can one reproduce the bug?
Steps to reproduce the behavior:
What is the expected behavior?
The AWSCredentialsProvider instance should be correctly passed through to the driver.
What is your host/environment?
The text was updated successfully, but these errors were encountered: