B4J Question ERROR with jRDC2 with B4a Client

ermales

Member
Licensed User
I followed the tutorial https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content
It works correctly when running everything as in the main activity, but when I try to do sql queries in another activity I get this error

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (inicio) Create, isFirst = true **
** Activity (inicio) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
ResponseError. Reason: java.lang.ClassNotFoundException: b4j.example.consultas$_dbcommand, Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 java.lang.ClassNotFoundException: b4j.example.consultas$_dbcommand</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /rdc. Reason:
<pre> java.lang.ClassNotFoundException: b4j.example.consultas$_dbcommand</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
</body>
</html>
ERROR: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 java.lang.ClassNotFoundException: b4j.example.consultas$_dbcommand</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /rdc. Reason:
<pre> java.lang.ClassNotFoundException: b4j.example.consultas$_dbcommand</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
</body>
</html>

if the same code if I put it back in the main the error is removed.
 

OliverA

Expert
Licensed User
Longtime User
Both DBResult and DBCommand Type still need to be declared in Process_Globals of Main, not the Activity
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I do not get it
In your B4A application that is not working with jRDC2, where do you have
B4X:
   Type DBResult (Tag As Object, Columns As Map, Rows As List)
   Type DBCommand (Name As String, Parameters() As Object)
?
Those two declarations must be in the "Sub Process_Globals" of Main, not your Activity. Plus, they need to be declared just like they are (including casing), since Type's are case sensitive (unlike everything else).
 
Upvote 0
Top