B4J Question (SOLVED) jRDC2 server error

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello team,

I have created couple of servers which working nice. I have created a new one. New database, new user for db connection and i updated the project with new directions of FCM Push notifications. But i get an error when trying to communicate with my b4a app:
B4X:
** Activity (main) Pause event (activity is not paused). **
** Activity (main) Resume **
ResponseError. Reason: Server Error, Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 java.lang.ClassNotFoundException: b4j.example.b4xmainpage$_dbcommand</title>
</head>
<body><h2>HTTP ERROR 500 java.lang.ClassNotFoundException: b4j.example.b4xmainpage$_dbcommand</h2>
<table>
<tr><th>URI:</th><td>/rdc</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>java.lang.ClassNotFoundException: b4j.example.b4xmainpage$_dbcommand</td></tr>
<tr><th>SERVLET:</th><td>anywheresoftware.b4j.object.JServlet-5609159b</td></tr>
</table>
<hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 11.0.9</a><hr/>
</body>
</html>
ERROR: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 java.lang.ClassNotFoundException: b4j.example.b4xmainpage$_dbcommand</title>
</head>
<body><h2>HTTP ERROR 500 java.lang.ClassNotFoundException: b4j.example.b4xmainpage$_dbcommand</h2>
<table>
<tr><th>URI:</th><td>/rdc</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>java.lang.ClassNotFoundException: b4j.example.b4xmainpage$_dbcommand</td></tr>
<tr><th>SERVLET:</th><td>anywheresoftware.b4j.object.JServlet-5609159b</td></tr>
</table>
<hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 11.0.9</a><hr/>
</body>
</html>
** Activity (main) Pause event (activity is not paused). **
** Service (starter) Destroy (ignored)**

The nohup output file:
B4X:
2023-08-02 10:43:52.001:INFO :cmvl.MLog:MLog-Init-Reporter: MLog clients using slf4j logging.
2023-08-02 10:43:52.463:INFO :cmvc.C3P0Registry:main: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
/home/wecreateapps/tmp
2023-08-02 10:43:52.964:INFO :oejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 11.0.20+8-post-Ubuntu-1ubuntu122.04
2023-08-02 10:43:53.220:INFO :oejss.DefaultSessionIdManager:main: Session workerName=node0
2023-08-02 10:43:53.263:INFO :oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@2bdd8394{/,file:///home/wecreateapps/tmp/www,AVAILABLE}
2023-08-02 10:43:53.369:INFO :oejs.RequestLogWriter:main: Opened /home/wecreateapps/tmp/logs/b4j-2023_08_02.request.log
2023-08-02 10:43:53.387:INFO :oejs.AbstractConnector:main: Started ServerConnector@26794848{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2023-08-02 10:43:54.422:INFO :oejus.SslContextFactory:main: x509=X509@5082d622(1,h=[wecreateapps.gr, www.wecreateapps.gr],a=[],w=[]) for Server@4278284b[provider=null,keyStore=file:///*,trustStore=null]
2023-08-02 10:43:54.671:INFO :oejs.AbstractConnector:main: Started ServerConnector@1e66f1f5{SSL, (ssl, http/1.1)}{0.0.0.0:8081}
2023-08-02 10:43:54.682:INFO :oejs.Server:main: Started Server@7e5afaa6{STARTING}[11.0.9,sto=0] @3411ms
jRDC is running (version = 2.1)
2023-08-02 10:44:07.282:INFO :cmvci.AbstractPoolBackedDataSource:qtp1876631416-14: 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 -> z8kfsxax1e9zkfp1uw73sh|184f6be2, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> org.mariadb.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> z8kfsxax1e9zkfp1uw73sh|184f6be2, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:mariadb://localhost/personal_project?characterEncoding=utf8, 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 ]
(ClassNotFoundException) java.lang.ClassNotFoundException: b4j.example.b4xmainpage$_dbcommand
Command: , took: 9ms, client=176.*.*.251

b4j log:
B4X:
176.*.*.251 - - [02/Aug/2023:07:44:52 +0000] "POST /rdc?method=query2 HTTP/1.1" 500 658 "-" "okhttp/4.9.0

testing server:
B4X:
RemoteServer is running (08/02/2023 10:55:39)
Connection successful.

I can't figure out last two days what is going wrong. I tried to load my other server, everything working fine!

SOLUTION:
Problem was at b4a code:
B4X:
Sub Process_Globals
    Public ActionBarHomeClicked As Boolean
    Type DBResult (Tag As Object, Columns As Map, Rows As List)
    Type DBCommand (Name As String, Parameters() As Object)
End Sub
These Types where declared at B4XMainPage and not on Main page
 
Last edited:
Top