B4J Question ABMaterial running on Google Compute Engine

walterf25

Expert
Licensed User
Longtime User
Hi all, i've recently started working on a web app that I will be using at work to keep track of lab materials, i was told by our Infrastructure security team that they needed to put this service behind a proxy, the problem is that i was also told that i would not be able to use port 3306 to connect to Mysql database running on the compute engine.

I am running debian 9 on that compute engine, the ABMaterial web app seems to run fine, but since I try to connect to Mysql server when the app starts it crashes with the following errors:
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@456d6c1e is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
dbm._getsql (java line: 283)
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:77)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
at anywheresoftware.b4j.object.ConnectionPool.GetConnection(ConnectionPool.java:45)
at com.ab.template.dbm._getsql(dbm.java:283)
at com.ab.template.main._appstart(main.java:71)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at com.ab.template.main.main(main.java:28)
Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@456d6c1e -- timeout at awaitAvailable()
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1467)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:554)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:758)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) at jdk.internal.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.mysql.jdbc.Util.handleNewInstance(Util.java:403) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)Oct 29, 2020 6:08:43 AM com.mchange.v2.resourcepool.BasicResourcePool WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@456d6c1e is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.

I have added a new user with all privileges to mysql database, it works fine when I run it in my home computer, is there anyother way to connect to mysql database when the service is behind a proxy?

Walter
 

incendio

Well-Known Member
Licensed User
Longtime User
Have you open the necessary port on your Compute Engine?
You should create a firewall rule on Compute Engine to open specific port.
It is under menu VPC Network.

Just want to share a little bit about Google compute engine.

A few months ago, I tried it, but now don't use it again. Main reason is cost.
For me it was about 3x higher than traditional VPS.

Perhaps it is because my compute engine has high traffic, and since it cost calculated by hour usage, the cost is much more expensive.
 
Last edited:
Upvote 0
Top