B4J Question jRDC2 Server (modified) Doesn't work When compiled as a standalone package

MrKim

Well-Known Member
Licensed User
Longtime User
I have a modified B4J server that compiles and runs fine.

Thought I would try the new ability non-ui programs as a standalone package.

I ran "Build Standalone Package" I copied my 'config.properties' file to .....\Objects\temp\build\bin.
I go back to .....\Objects\temp\build and run the executable and I get the following errors.

B4X:
2021-06-11 03:12:43.074:INFO::main: Logging initialized @234ms to org.eclipse.jetty.util.log.StdErrLog
Jun 11, 2021 3:12:43 AM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
Jun 11, 2021 3:12:43 AM com.mchange.v2.c3p0.C3P0Registry
INFO: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
Jun 11, 2021 3:12:43 AM 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 -> 1hge0wdah1xirq0t6cjafa|4516af24, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> net.sourceforge.jtds.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge0wdah1xirq0t6cjafa|4516af24, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:jtds:sqlserver://localhost:1433/SkDataDemo44;useLOBs=false, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 150, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {password=******, user=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> true, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
Unable to Connect try 1 of 20.
Make sure your config.properties file is correct and your SQL instance is running!
Unable to Connect try 2 of 20.
Make sure your config.properties file is correct and your SQL instance is running!
Jun 11, 2021 3:13:28 AM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6f8d74a7 -- 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: Could not find a Java charset equivalent to DB charset Cp1252.
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.loadCharset(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.<init>(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.Driver.connect(Unknown Source)
        at b4j/com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.access$700(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(Unknown Source)
        at b4j/com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Unknown Source)

Jun 11, 2021 3:13:28 AM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@38c6f217 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
Unable to Connect try 3 of 20.
Make sure your config.properties file is correct and your SQL instance is running!
Jun 11, 2021 3:13:28 AM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@5019b94c -- 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: Could not find a Java charset equivalent to DB charset Cp1252.
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.loadCharset(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.<init>(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.Driver.connect(Unknown Source)
        at b4j/com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.access$700(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(Unknown Source)
        at b4j/com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Unknown Source)

Jun 11, 2021 3:13:28 AM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@38c6f217 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
Unable to Connect try 4 of 20.
Make sure your config.properties file is correct and your SQL instance is running!
Jun 11, 2021 3:13:28 AM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@5437f2fd -- 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: Could not find a Java charset equivalent to DB charset Cp1252.
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.loadCharset(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.<init>(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.Driver.connect(Unknown Source)
        at b4j/com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.access$700(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(Unknown Source)
        at b4j/com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Unknown Source)

Jun 11, 2021 3:13:28 AM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@38c6f217 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
Unable to Connect try 5 of 20.
Make sure your config.properties file is correct and your SQL instance is running!
Unable to Connect try 6 of 20.
Make sure your config.properties file is correct and your SQL instance is running!
Unable to Connect try 7 of 20.
Make sure your config.properties file is correct and your SQL instance is running!

Compiling normally and running run_debug.bat yields the following:
B4X:
D:\Android\B4X\DBConnector\SKDBServer\SKDBServer\Objects>C:\Java\jdk-11.0.1\bin\java.exe -jar SKDBServer.jar
2021-06-11 04:07:25.647:INFO::main: Logging initialized @388ms to org.eclipse.jetty.util.log.StdErrLog
Jun 11, 2021 4:07:25 AM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
Jun 11, 2021 4:07:26 AM com.mchange.v2.c3p0.C3P0Registry
INFO: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
Jun 11, 2021 4:07:26 AM 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 -> 1hge0wdah1xkq2w81959on2|1e802ef9, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> net.sourceforge.jtds.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge0wdah1xkq2w81959on2|1e802ef9, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:jtds:sqlserver://localhost:1433/SkDataDemo44;useLOBs=false, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 150, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {password=******, user=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> true, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
MaxFileSize
2021-06-11 04:07:27.301: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-11 04:07:27.343:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2021-06-11 04:07:27.343:INFO:oejs.session:main: No SessionScavenger set, using defaults
2021-06-11 04:07:27.347:INFO:oejs.session:main: node0 Scavenging every 660000ms
2021-06-11 04:07:27.354:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@295cf707{/,file:///D:/Android/B4X/DBConnector/SKDBServer/SKDBServer/Objects/www,AVAILABLE}
2021-06-11 04:07:27.358:INFO:oejs.AbstractNCSARequestLog:main: Opened D:\Android\B4X\DBConnector\SKDBServer\SKDBServer\Objects\logs\b4j-2021_06_11.request.log
2021-06-11 04:07:27.540:INFO:oejs.AbstractConnector:main: Started ServerConnector@58594a11{HTTP/1.1,[http/1.1]}{0.0.0.0:17178}
2021-06-11 04:07:27.543:INFO:oejs.Server:main: Started @2290ms
SkDBServer is running (version = 2.22)
They look identical to me except one fails and one does not.

Any help appreciated.
 

Magma

Expert
Licensed User
Longtime User
Hi there...
do you run it at the same pc you ve tested before?

or copying to another... and then tested it ? if this is what you do just copy your database (with the way must be sql backup) + install database drivers+(mysql/mariadb/mssql) + copy config.properties to the right folder and edit with username/password or what else need..
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Hi there...
do you run it at the same pc you ve tested before?
Of course. All on the same computer, using the same config file. Nothing is moved anywhere except the config.properties file gets copied to bin after creating the package.
Same computer same SQL Server Instance same database same config.properties.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
bin? if the config.properties was on a folder into the project... for example

...if was in c:\a\b\config.properties must go in c:\a\objects\b\config.properties

...if was in c:\a\config.properties must go in c:\a\objects\config.properties

....in objects not in bin... :-(
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
bin? if the config.properties was on a folder into the project... for example

...if was in c:\a\b\config.properties must go in c:\a\objects\b\config.properties

...if was in c:\a\config.properties must go in c:\a\objects\config.properties

....in objects not in bin... :-(
I started with it in \build and got the error that it couldn't find the \Objects\temp\build\bin\config.properties file. So I put it in the \bin directory and that issue went away.
If you look at the two logs I posted they appear to me to be identical until "Unable to connect."
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Actually, to be pedantic, you didn't say what version of B4A you were trying it with.
I apologize for being unclear. what I meant by that was, before 9 you could NOT create a stand alone package. It would would not let you do it. What I DID say was that I thought I would try the new ability to create stand alone packages which, by definition means I must be using 9.

Put a big smiley face here and a giant grain of salt. It is late, I am tired and I keep making the stupid mistake of posting when I am tired.

agraham, your posts have helped me enormously over the years, so let me just take the time now to say thanks for all of the help you have provided. I am always grateful for your advice.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
The current jServer library isn't compatible with the modules system. You might be able to get it working but some features might not work.

Try to add this:
B4X:
#PackagerProperty: IncludedModules = jdk.charsets

Didn't do it. Thanks for taking a look. Here is the log after adding the line. I can work with the batch command. An exe would just be cleaner for our customers.

B4X:
2021-06-13 05:59:24.322:INFO::main: Logging initialized @238ms to org.eclipse.jetty.util.log.StdErrLog
Jun 13, 2021 5:59:24 AM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
Jun 13, 2021 5:59:25 AM com.mchange.v2.c3p0.C3P0Registry
INFO: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
Jun 13, 2021 5:59:25 AM 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 -> 1hge0wdai1ihqeehzigpa|4ae82894, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> net.sourceforge.jtds.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge0wdai1ihqeehzigpa|4ae82894, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:jtds:sqlserver://localhost:1433/SkDataDemo44;useLOBs=false, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 150, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {password=******, user=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> true, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
Unable to Connect try 1 of 20.
Make sure your config.properties file is correct and your SQL instance is running!
Jun 13, 2021 6:00:08 AM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1c47fdc6 -- 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: Could not find a Java charset equivalent to DB charset Cp1252.
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.loadCharset(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.<init>(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.Driver.connect(Unknown Source)
        at b4j/com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.access$700(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(Unknown Source)
        at b4j/com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Unknown Source)

Jun 13, 2021 6:00:08 AM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@478190fc is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
Unable to Connect try 2 of 20.
Make sure your config.properties file is correct and your SQL instance is running!
Jun 13, 2021 6:00:09 AM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@ec0d076 -- 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: Could not find a Java charset equivalent to DB charset Cp1252.
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.loadCharset(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.<init>(Unknown Source)
        at b4j/net.sourceforge.jtds.jdbc.Driver.connect(Unknown Source)
        at b4j/com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(Unknown Source)
        at b4j/com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool.access$700(Unknown Source)
        at b4j/com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(Unknown Source)
        at b4j/com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Unknown Source)
 
Upvote 0
Top