B4J Question JRDC2 pool connection errors

Rachbob

Member
Licensed User
Hello everyone
i made a small application with B4A connceted to a remote database. everything is OK in localhost. then i put the database ina real remote host. i changed all configuration ( IP passwors port..). when runing my app i got those errors :

juin 01, 2020 4:37:53 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource

INFOS: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 20000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hgf56pa7l1r4uvn3|1d1d, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hgf56paav7uvn3|111d, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://182.31.14.25/sql1764697, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnections...
(TimeoutException) com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@87caf7 -- timeout at awaitAvailable()

(TimeoutException) com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@87caf7 -- timeout at awaitAvailable()

Command: , took: 20190ms, client=192.168.1.9
 

MicroDrie

Well-Known Member
Licensed User
Or a firewall is blocking in-comming traffic to the database on the remote server. You best bet is to install the free "database browser" program. There are two version availiable: Standard and Portable
  • The standard version can be installed on Windows PC.
  • The portable version is designed to work with PortableApps Menu which can be downloaded from here
The benefit of the portable apps version is that you wil automaticcaly upgrade to the last version. You can setup the connection to your mySQL database server and test the connection. The Database Browser program gives some information about the tested connection.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
jdbc:mysql://xxx.xxx.xxx.xxx/sql1764697
Searching for this IP address, the result shows that the IP block is owned by Sxxxxxxxxx Cable Television. Are you self hosting the database at home? Checking out port 3306 (the default port number for MySQL) on that IP address reveals that the port is closed. That usually means that the modem/router is net set up to forward that particular port to your machine hosting the MySQL database.

Note: Even though it did help in this case (I was able to determine your port was closed), in the future you may want to block out any personal identifying information in the log outputs/code listings. You could always make it available by request via PM.
 
Upvote 0

Rachbob

Member
Licensed User
this is my database configuration hoted in www*mysqlhosting*net :

#DATABASE CONFIGURATION
DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://172.31.17.25:3306/sql10344697
User=**hiden***
Password=**hiden**
#Java server port
ServerPort=17178
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
So what error message are you getting now? This configuration does not match the configuration of the log output posted in the initial post.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Upvote 0

Rachbob

Member
Licensed User
So what error message are you getting now? This configuration does not match the configuration of the log output posted in the initial post.
i am ckeking with the router and Windows firewall. i tried to ununstall xampp to see if there is conflict of port 3306. but got same message errors. i will try to change te DB hosting to see what will happen.
 
Upvote 0

Rachbob

Member
Licensed User
I got it . in my config file the JdbcUrl shoud be :

JdbcUrl=jdbc:mysql://<database server name>:3306/sql10344697

in stead of :

JdbcUrl=jdbc:mysql://182.31.17.25:3306/sql10344697

thank you @Erel @olivierA @MicroDrie
 
Upvote 0
Top