Search code examples
javamysqlantubuntu-14.04opentaps

Unable to acquire a new connection from the pool while running opentaps


I am trying to install opentaps on Ubuntu 14.04 server with MySQL 5.5.43. I am using putty to RDC from windows to the ubuntu server and doing all the required changes.

I have successfully installed MySQL, created database "opentaps", created user "opentaps" with password "opentaps",granted privilege to the user.

I have changed the the file framework/entity/config/entityengine.xml as per the following instructions: http://www.opentaps.org/docs/index.php/Using_opentaps_ERP_%2B_CRM_with_MySQL

After I run "ant run-install", I got this error:

[java] ---- exception report ----------------------------------------------------------
     [java] Failure in findListIteratorByCondition operation for entity [DynamicView]: org.ofbiz.entity.GenericDataSourceException: Unable to esablish a connection with the database. (Unable to acquire a new connection from the pool). Rolling back transaction.
     [java] Exception: org.ofbiz.entity.GenericDataSourceException
     [java] Message: Unable to esablish a connection with the database. (Unable to acquire a new connection from the pool)
     [java] ---- cause ---------------------------------------------------------------------
     [java] Exception: java.sql.SQLException
     [java] Message: Unable to acquire a new connection from the pool
     [java] ---- cause ---------------------------------------------------------------------
     [java] Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException
     [java] Message: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
     [java] ---- cause ---------------------------------------------------------------------
     [java] Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
     [java] Message: Communications link failure
     [java]
     [java] The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
     [java] ---- cause ---------------------------------------------------------------------
     [java] Exception: java.net.ConnectException
     [java] Message: Connection refused

Please help me in this. Thanks


Solution

  • I got the solution for the issue I was facing.

    It was happening because I was installing opentaps on Ubuntu server and I was using "127.0.0.1" IP address in the "entityengine.xml" configuration file. Whereas It needs to use IP address of the server on which installation is going on. Such as:

    jdbc-uri="jdbc:mysql://Server IP/opentaps?autoReconnect=true&useOldAliasMetadataBehavior=true"

    It also needs to give grant privileges to MySQL user for the IP address of the server. Such as :

    grant all privileges on opentaps.* to 'opentaps'@'Server IP' identified by 'opentaps-password' with grant option;

    Thank you.