Skip to content

NullPointerException During Oracle Connection Initialization in AWS SCT Batch CLI

0

I am running the AWS SCT Batch CLI and receiving a NullPointerException during the AddSource command, even though all Oracle connection parameters are supplied. Here is the AddSource command I used: AddSource -name: 'ORACLE_SOURCE' -vendor: 'ORACLE' -connectionType: 'tns_alias' -tnsAlias: 'MYDB' -tnsFilePath: '/opt/oracle/network/admin/tnsnames.ora' -host: 'myhost' -port: '1521' -user: 'user' -password: 'password' Even with correct credentials and a valid TNS alias in tnsnames.ora, SCT still fails with: java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.putVal at java.util.Properties.put at java.lang.System.setProperty at com.amazon.sct.dbloader.properties.OracleConnectionProperties.<init> It appears that SCT is treating one of the connection properties as null, but all parameters seem to be provided. What additional configuration or parameter is needed to prevent SCT from creating a null connection property during AddSource, and how can I identify which field is causing the NullPointerException?

1 Answer
0

Based on the error you're encountering, it appears there's an issue with how the Oracle connection properties are being initialized in AWS Schema Conversion Tool (SCT) Batch CLI.

When using the TNS alias connection type, you need to ensure you're providing all the required parameters correctly. Looking at your command, I notice you're mixing connection approaches. When using the -connectionType: 'tns_alias' option, you should not need to specify both the TNS alias information and the host/port separately, as this could be causing conflicts.

Try modifying your AddSource command to use only the TNS-specific parameters:

AddSource
-name: 'ORACLE_SOURCE'
-vendor: 'ORACLE'
-connectionType: 'tns_alias'
-tnsAlias: 'MYDB'
-tnsFilePath: '/opt/oracle/network/admin/tnsnames.ora'
-user: 'user'
-password: 'password'

Remove the -host and -port parameters since those are already defined in your tnsnames.ora file for the MYDB alias.

If you continue to experience issues, verify that:

  1. The tnsnames.ora file exists at the specified path and has the correct permissions
  2. The MYDB alias is properly defined in the tnsnames.ora file
  3. The Oracle client libraries are correctly installed and configured
  4. The user has the necessary permissions to access the Oracle database (including SELECT_CATALOG_ROLE and SELECT ANY DICTIONARY privileges)

If the issue persists, you could try using a different connection type such as 'sid' or 'service_name' instead of 'tns_alias' to see if that resolves the NullPointerException.
Sources
Connecting to Oracle Databases with the AWS Schema Conversion Tool - AWS Schema Conversion Tool
Troubleshooting issues with AWS Schema Conversion Tool - AWS Schema Conversion Tool

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.