B4J Question ABMaterial - cannot get logged into the database

sdod

New Member
It looks like I am a little late to the ABMaterial party but it seems interesting so I am trying to work through the tutorial. I am also VERY new to B4J so trying to learn it as well. I really like it so far.

The issue I am experiencing is with lesson 3 where it connects to a mySQL DB. I have the DB set up and it has the data in it. However, when I try to log in it does nothing. The logs are listed below.

Also, in the ABMShared module line 298 "Sub ConnectNavigationBar2" has the warning unused variable 'ismember'

My Connection: I have verified the database name is harris_tmp, the user admin exists, the password matches and has full permissions.
1623176751732.png

Any assistance will be greatly appreciated.


Logs when trying to log into ABMaterial database:
init mysql
Jun 08, 2021 2:17:25 PM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
Jun 08, 2021 2:17:25 PM com.mchange.v2.c3p0.C3P0Registry
INFO: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
loading C:\Users\sdod\DOCUME~1\MYPROG~1\ABMATE~1\ABM4.51\Template\Objects: copymewithjar.needs...
Using cache system: 3.0
Current App version: 1623174879186
Needs material/awesome icons
Building core.min.1623174879186.css...
2021-06-08 14:17:25.615:INFO::main: Logging initialized @658ms to org.eclipse.jetty.util.log.StdErrLog
2021-06-08 14:17:25.688:INFO:oejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 11.0.1+13
2021-06-08 14:17:25.723:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2021-06-08 14:17:25.723:INFO:oejs.session:main: No SessionScavenger set, using defaults
2021-06-08 14:17:25.724:INFO:oejs.session:main: node0 Scavenging every 600000ms
2021-06-08 14:17:25.745:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@4e423aa2{/,file:///C:/Users/sdod/Documents/MyPrograms/ABMaterial/ABM4.51/Template/Objects/www/,AVAILABLE}
2021-06-08 14:17:25.748:INFO:oejs.AbstractNCSARequestLog:main: Opened C:\Users\sdod\Documents\MyPrograms\ABMaterial\ABM4.51\Template\Objects\logs\b4j-2021_06_08.request.log
2021-06-08 14:17:25.764:INFO:oejs.AbstractConnector:main: Started ServerConnector@9acd4f4{HTTP/1.1,[http/1.1]}{0.0.0.0:51045}
2021-06-08 14:17:25.764:INFO:oejs.Server:main: Started @807ms
2021-06-08 14:17:25.774:INFO:oejs.AbstractConnector:main: Stopped ServerConnector@9acd4f4{HTTP/1.1,[http/1.1]}{0.0.0.0:51045}
2021-06-08 14:17:25.774:INFO:oejs.session:main: node0 Stopped scavenging
2021-06-08 14:17:25.776:INFO:oejsh.ContextHandler:main: Stopped o.e.j.s.ServletContextHandler@4e423aa2{/,file:///C:/Users/sdod/Documents/MyPrograms/ABMaterial/ABM4.51/Template/Objects/www/,UNAVAILABLE}
2021-06-08 14:17:25.778:INFO:oejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 11.0.1+13
2021-06-08 14:17:25.783:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@4e423aa2{/,file:///C:/Users/sdod/Documents/MyPrograms/ABMaterial/ABM4.51/Template/Objects/www/,AVAILABLE}
2021-06-08 14:17:25.784:INFO:oejs.AbstractNCSARequestLog:main: Opened C:\Users\sdod\Documents\MyPrograms\ABMaterial\ABM4.51\Template\Objects\logs\b4j-2021_06_08.request.log
2021-06-08 14:17:25.784:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2021-06-08 14:17:25.784:INFO:oejs.session:main: No SessionScavenger set, using defaults
2021-06-08 14:17:25.784:INFO:oejs.session:main: node0 Scavenging every 660000ms
2021-06-08 14:17:25.787:INFO:oejs.AbstractConnector:main: Started ServerConnector@9acd4f4{HTTP/1.1,[http/1.1]}{0.0.0.0:51045}
2021-06-08 14:17:25.788:INFO:oejs.Server:main: Started @830ms
2021-06-08 14:17:25.789:INFO:oejs.session:main: node0 Scavenging every 900000ms
Connected
Waiting for value (3 ms)
Waiting for value (1 ms)
Waiting for value (1 ms)
Disconnected
Home Page Connected
Waiting for value (1 ms)
UpdateFromCache: HomePage2edb66cf-5030-4df1-8e65-eb579cbc28d3
Saving the first instance
Waiting for value (1 ms)
Websocket first connection
Waiting for value (2 ms)
  -- This Page ID: HomePage2edb66cf-5030-4df1-8e65-eb579cbc28d3
/template/images/list1.jpg
Not Found
/template/images/list2.jpg
Not Found
 *** Page Event name: page_navigationbarclicked  (MyMap) {eventparams=action,value, action=Login, value=, eventname=page_navigationbarclicked}
Waiting for value (6 ms)
 *** Page Event name: page_modalsheetready  (MyMap) {eventparams=modalsheetname, eventname=page_modalsheetready, modalsheetname=login}
 *** Page Event name: logininp1_gotfocus  (MyMap) {eventparams=, eventname=logininp1_gotfocus}
 *** Page Event name: logininp1_lostfocus  (MyMap) {eventparams=, eventname=logininp1_lostfocus}
 *** Page Event name: logininp2_gotfocus  (MyMap) {eventparams=, eventname=logininp2_gotfocus}
 *** Page Event name: logininp2_tabpressed  (MyMap) {eventparams=target,value, value=, eventname=logininp2_tabpressed, target=logininp2}
 *** Page Event name: logininp2_lostfocus  (MyMap) {eventparams=, eventname=logininp2_lostfocus}
 *** Page Event name: loginbtn_clicked  (MyMap) {eventparams=target, eventname=loginbtn_clicked, target=login-footer-loginbtn}
Waiting for value (6 ms)

Jun 08, 2021 2:18:30 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource
INFO: 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 -> 1bqouw6ah1tprhunqa1rrk|58c1c010, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1bqouw6ah1tprhunqa1rrk|58c1c010, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost/harris_tmp?characterEncoding=utf8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdl...
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:120)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:126)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:191)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:496)
    at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:442)
    at com.ab.template.homepage._page_parseevent(homepage.java:251)
    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)
    ... 10 more
Caused by: java.lang.RuntimeException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:120)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:487)
    ... 17 more
Caused by: 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:282)
    at com.ab.template.abmloginhandler$ResumableSub_HandleLogin.resume(abmloginhandler.java:202)
    at com.ab.template.abmloginhandler._handlelogin(abmloginhandler.java:125)
    at com.ab.template.homepage._loginbtn_clicked(homepage.java:163)
    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)
    ... 18 more
Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@2e729648 -- 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.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:685)
    ... 29 more
 *** Page Event name: loginbtn_clicked  (MyMap) {eventparams=target, eventname=loginbtn_clicked, target=login-footer-loginbtn}
Waiting for value (1 ms)
 

Xandoca

Active Member
Licensed User
Longtime User
Hi @sdod ,

List of things I would check:
1) Did you include #AdditionalJar: mysql-connector-java-5.1.48-bin in Main Module?
2) Did you put the file mysql-connector-java-5.1.48-bin.jar in additional libraries folder?
3) Are you using the compatible mysql-connector with your MySQL version?
4) Can you telnet MySQL on port 3306?
go on cmd and "telnet localhost 3306"
5) have you tried to turn off you firewall and see if it works?
6) Did you try to connect using your ip instead of localhost?

Regards
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Hope you are doing well.
As addressed above, there are many things that must come together... as they shall, as you learn...
 
Upvote 0

sdod

New Member
Xandoca...thank you for the list of things to check. I am using USBWebserver_v8.6 as my WAMP. I found it had the Mysql set to port 3307. I changed it to 3306 and the login process started working.

Harris, I appreciate the encouragement. I will keep on keeping on.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
I am using USBWebserver_v8.6 as my WAMP. I found it had the Mysql set to port 3307. I changed it to 3306 and the login process started working.
I had the exact same problem starting out. Dang ports....
Now we forge ahead....
 
Upvote 0
Top