How to resolve the "Failed to initialize pool: ONS configuration failed" error
Learn how to fix the error that occurs when a Java application cannot connect to an Oracle database.
Last updated
Learn how to fix the error that occurs when a Java application cannot connect to an Oracle database.
Last updated
If you try to connect a Java application to the Oracle database, you may receive the following error message:
This error is caused by incorrect settings of the Oracle Notification Service (ONS). This service notifies the application of database changes, but inadequate configuration can break connectivity and cause this issue.
To resolve this error, disable the ONS function by adding a specific parameter to the configuration of your connector. Follow the steps below:
Open the configuration of a database connector (normally the DB connector is used in these cases).
Find the parameter that contains the configuration of the Oracle database.
Add the following line to disable ONS: "oracle.jdbc.fanEnabled" : false
Save the connector and test the execution.
If the configuration is correct, the database connection should now be successful.