Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory
search cancel

Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory

book

Article ID: 333480

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

The following conditions, events or system behaviors may have this issue:
  • Following installation of the Watch4net Smarts SolutionPack the event-processing-manager emc-smarts service does not start.
  • Watch4net emc-smarts Data collection and events for the Smarts SolutionPack are installed on one node while the emc-smarts report server is on another node (where the SQL Database is located).
  • The following error can be seen in the Watch4net Smarts SolutionPack processing-0-0.log
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.) at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory
  • Watch4net default install on one server and Watch4net minimal installation on a second server.
  • Second server registered in Watch4net Centralized Management.
  • Smarts SolutionPack Data collection and Events installed on second server
  • Smarts SolutionPack Reports installed on first server.


Environment

Watch4Net/M&R - 7.0u8 to 7.5.x

Cause

The error referenced above in the processing-0-0.log indicates that connection to the SQL database has been refused. By default, the SQL database will only grant permissions to 'localhost'. Since the Smarts SolutionPack has been installed on a remote server, permissions need to be specifically granted for the remote server to the relevant tables.

Resolution

To grant access to the database for a remote host and address this issue, do the following:

  1. On the localhost to the database, log in as root and navigate to /opt/APG/bin.
  2. Enter the following command:
./mysql-client.sh
  1. Enter the usernamfe password and database login at the prompt:
Enter username: [apg]

root
Enter database: [apg]

Enter password:

  1. List the databases on the host using the following command:

mysql> show databases;

This command will generate a table similar to the following:

+------------------------------+
| Database                     |
+------------------------------+
| information_schema           |
| apg                          |
| events                       |
| master                       |

| mysql                        |
| performance_schema           |
| topology                     |
+------------------------------+
7 rows in set (0.00 sec)

  1. Grant all privileges to the remote host to events, apg and master. To do this, enter the following commands to grant permission to the databases required:

 mysql> grant all privileges on events.* to 'apg'@'<remote host IP address>' identified by 'watch4net';
 
 mysql> grant all privileges on apg.* to 'apg'@'<remote host IP address>' identified by 'watch4net';
 
 mysql> grant all privileges on master.* to 'apg'@'<remote host IP address>' identified by 'watch4net';

 FLUSH PRIVILEGES;

(replace <remote host IP address> in the above commands with the IP address of the remote server).
  1. Start the Event-Processing-Manager EMC-Smarts service by running the following command:
/opt/APG/bin/manage-modules.sh service start event-processing-manager emc-smarts