B4J Question JRDC connection issues - java.sql.SQLException: No suitable driver

Spuds

Member
Licensed User
Help please!

Getting java.sql.SQLException: No suitable driver

Trying to connect to MS Sql server on same machine as B4J Connection Manager using RDCConnector. Server is running and can connect locally and remotely on port 1433.

Using:
#AdditionalJar: mssql-jdbc-7.4.1.jre11 (jar file placed in Additional libraries directory)

Properties.config:
DriverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
JdbcUrl=jdbc:sqlserver://localhost/USOpenRFID
#jdbc:sqlserver://localhost;user=Bryan;password=kedman;

User=Bryan
Password=*******
#Java server port
ServerPort=17178

From browser:
RemoteServer is running (01/13/2020 13:38:54)
Error fetching connection.

Log File:
Waiting for debugger to connect...
Program started.
2020-01-13 14:33:15.019:INFO::main: Logging initialized @638ms to org.eclipse.jetty.util.log.StdErrLog
Jan 13, 2020 2:33:15 PM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
Jan 13, 2020 2:33:15 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]
2020-01-13 14:33:15.575:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 11.0.1+13
2020-01-13 14:33:15.627:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0
2020-01-13 14:33:15.627:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2020-01-13 14:33:15.630:INFO:eek:ejs.session:main: node0 Scavenging every 660000ms
2020-01-13 14:33:15.637:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@7283d3eb{/,file:///C:/Users/Bryan/Downloads/Bas%20program/jRDC/Objects/www,AVAILABLE}
2020-01-13 14:33:15.640:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened C:\Users\Bryan\Downloads\Bas program\jRDC\Objects\logs\b4j-2020_01_13.request.log
2020-01-13 14:33:15.661:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@560348e6{HTTP/1.1,[http/1.1]}{0.0.0.0:17178}
2020-01-13 14:33:15.661:INFO:eek:ejs.Server:main: Started @1289ms
Emulated network latency: 100ms
jRDC is running (version = 2.22)
Jan 13, 2020 2:33:26 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 -> 1hge11ka718i5f19gua2zl|1622f1b, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.microsoft.sqlserver.jdbc.SQLServerDriver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge11ka718i5f19gua2zl|1622f1b, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnections -> 0, ma...
Jan 13, 2020 2:33:56 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2dc706b7 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: No suitable driver
at java.sql/java.sql.DriverManager.getDriver(DriverManager.java:298)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285)
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)
Jan 13, 2020 2:33:56 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1502fc0 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: No suitable driver
at java.sql/java.sql.DriverManager.getDriver(DriverManager.java:298)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285)
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)
Jan 13, 2020 2:33:56 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@6057aebb is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
Jan 13, 2020 2:33:56 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@6057aebb is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
Jan 13, 2020 2:33:56 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@698da3d4 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: No suitable driver
at java.sql/java.sql.DriverManager.getDriver(DriverManager.java:298)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285)
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)
Jan 13, 2020 2:33:56 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@6057aebb is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
 

Spuds

Member
Licensed User
Yes
C:\Java\jdk-11.0.1\bin\javac.exe

Thank you for your help!

I got past that error but now stuck again. I am able to log into SQL server remotely using SSMS and a UDL file. I am 100% sure the connection parameters are correct. The SQL sever is a single instance not a named instance. Tried with firewall off and got the same. Help please.

From log file:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost/USOpenRFID, port 1433 has failed. Error: "localhost/USOpenRFID. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

Config.properties:
DriverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
JdbcUrl=jdbc:sqlserver://localhost/USOpenRFID
User=Bryan
Password=******
#Java server port
ServerPort=17178
 

Spuds

Member
Licensed User
According to this setting, you are accessing the server on the same machine as you are running the jRDC server. Is that correct?
Yes. I have tried localhost, 172.0.0.1 and the server IP with the same result.
Additionally, I setup SQL Express on a different box and got same result.

Really appreciate your help this issue is jeopardizing my entire project.
 

OliverA

Expert
Licensed User
1) localhost = 127.0.0.1 (hoping yours is just a typo)
2) If the database is not running on the same box as your jRDC2 server, than neither localhost, nor 127.0.0.1 will ever connect to it
3) If your database is on a different machine, can you access it via SSMS from the same machine that the jRDC2 software is running?
a) If yes, then what IP/domain name are you using? What port are you using? You have to use the same two items in your config file for jRDC2
b) If no, then you have other issues outside of jRDC2's control (usually firewall issues)
 
Top