B4J Question Testing jRDC2 with oracle

Bladimir Carrillo

Member
Licensed User
Longtime User
Hello all,

I am testing my application to change from RDC to jRDC2.

Test #1 on first Activity
Action:

ExecuteQuery (SELECT statement)

A. Client side in Debug mode

Results:
a. With MsSQL and MySQL works well
b. With Oracle, I have an error in the DBRequestManager module, Sub ser_BytesToObject, on the following line:

B4X:
res.Tag = m.Get("tag")

Error:
Error reading response: (EOFException) java.io.EOFException
Error occurred on line: 83 (DBRequestManager)
java.lang.NullPointerException
at anywheresoftware.b4a.shell.Shell.setField(Shell.java:613)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:349)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:244)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:132)
at anywheresoftware.b4a.BA$3.run(BA.java:334)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5099)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:803)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:570)
at dalvik.system.NativeStart.main(Native Method)

The error occurs several miliseconds after ending JobDone Sub with Job.Success = true.

B. Client side in Release mode

Results:
a. With MsSQL and MySQL works well
b. With oracle, I have an error (attached image) on the device:



Test #2 on second Activity with MsSQL

* Test #1 on first activity works fine, that is JobDone and ReqManager_Result subs completed successfull.

Action:
ExecuteQuery (SELECT statement), same as excecuted on first activity.

A. Client side in Debug mode

Results:

JobDone sub completed, but ReqManager_Result sub never begins.


In advance, thank you for any assistance.
 

Bladimir Carrillo

Member
Licensed User
Longtime User
Lets start with the first issue. Are you monitoring the B4J server for any errors?

Based on this line: Error reading response: (EOFException) java.io.EOFException, the response was invalid.

Yes,
Running de jRDC2 jar file (generated in release mode) and running in B4J ide, no errors appears.
 
Upvote 0

Bladimir Carrillo

Member
Licensed User
Longtime User
Run your app in debug mode and check the logs. It should print the server response.

Server logs:
res: 789C5D915F4F833014C5A957C79CCE7F53637CF2C1E78507BF005048889419A8C6B7A664C4600A3376CB8C9FDEB6D085F9D2F4FEEE39BDA7ED1DBA771CA77CFA9C573FBCF912D5BCE175FBC896E5772537627DA8BA68AA9644266DBDAEB9A87FABA58B102846F987835CB5095762D3B4F27AA6D523ADC68CE0546B76350D5240BA3E524B465880E1C0B655A9DB5A8F269D3C4EB19F2D9EC10418771AC340FBD1F18E243883D17FE483BBEFC3058C2D794BFB93B4C3E4EFE63398D87C095EE4184EAC43E579C9894A733A2061162B321D90E89D2A7236B874802338DF9F12C185B550C2123FA4115C5A1287ECD5902B4DF4DDF3D556DEE877BB9DD97005F13CCF4C28D489A5E8C773A6B067FF8BF25270F950D492F8A1B1797DDBF903DD6D4BC7
Error reading response: (EOFException) java.io.EOFException
Error occurred on line: 86 (DBRequestManager)
java.lang.NullPointerException
at net.sismac.sts.dbrequestmanager._ser_bytestoobject(dbrequestmanager.java:419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:697)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:336)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5099)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:803)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:570)
at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **

line 86:
res.Tag = m.Get("tag")
 
Upvote 0

KingKing

Member
Licensed User
Longtime User
Hi All,

I believe I also has the same error in B4A when testing RDC2. However I am testing on PostgreSQL 9.3 in Windows 7 (32bit)
I select 3 fields from a table without parameter and it pop up the error. I have the checked the SQL statement and it returns data. No null data is return.

Appreatiate if anybody can assist me to fix this error. Thank you.
Below are B4A and B4J log file.

I have added this code to HandleJobAsync, just before calling ser.ConvertBytesToObjectAsync(data, "ser")

B4X:
    Dim bc As ByteConverter
Log("res: " & bc.HexFromBytes(data))

B4A Client Log:
** Activity (main) Resume **
Installing file.
** Activity (main) Pause, UserClosed = false **
PackageAdded: package:b4a.id
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (frmmainmenu) Create, isFirst = true **
** Activity (frmmainmenu) Resume **
** Activity (frmmainmenu) Pause, UserClosed = false **
** Activity (frmsync) Create, isFirst = true **
** Activity (frmsync) Resume **
User click SYNC button.
** Service (httputils2service) Create **
** Service (httputils2service) Start **
res: 789C8D91414BC3401085B34629A8BD6911F1B007D156B0281473B756EC45B009E82D4CDD215DDDEC96CD466D7FBDBB598D3445F4F232EFCD97093339208741104C072F7DFC807C2EB09F0397C7299B6A2C4A61366D97B4AD8C8BB1E48683E04B642D42429B259005A4658BA112652E8B3D17922D2B6F204A742E206E82841C43E2DCAE1560E9B3E0284DCA59B8F1CD4CD47BB1EFDA9D6A8AA32F2A3DF3C18E95D8288DF45E69336BFA2614AB7205AABC87B6EB70048569D826F2882B88B31E69D7D9D0AEA241AC271E741BDE3D7C3D3AF5896E3497AF3F956FB843DC2AC5EAC2C7EE2C1334C005AD3EB01678ECA8FA156ED985449D2D68A2817199D198497A3D63E4F40F8076AF2EA3281A9C3FF5FCC493DF5EE826C0E7B6E8D5B3FF8F7E02EF668C88
Class not found: b4j.example.main$_dbresult, trying: b4a.id.main$_dbresult
Error reading response: (EOFException) java.io.EOFException
Error occurred on line: 85 (DBRequestManager)
java.lang.NullPointerException
at b4a.id.dbrequestmanager._ser_bytestoobject(dbrequestmanager.java:411)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:697)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:336)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5349)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:835)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
at dalvik.system.NativeStart.main(Native Method)
** Service (starter) Destroy **
** Activity (main) Resume **



B4J Log :
Program started.
2016-01-21 23:12:54.238:INFO::main: Logging initialized @626ms
Jan 21, 2016 11:12:54 PM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Jan 21, 2016 11:12:54 PM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.2.1 [built 20-March-2013 11:16:28 +0000; debug? true; trace: 10]
2016-01-21 23:12:54.729:INFO:eek:ejs.Server:main: jetty-9.3.z-SNAPSHOT
2016-01-21 23:12:54.786:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@1275dab{/,file:///C:/Temp/idmobile_server/jRDC2/jRDC/Objects/www,AVAILABLE}
2016-01-21 23:12:54.789:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened C:\Temp\idmobile_server\jRDC2\jRDC\Objects\logs\b4j-2016_01_21.request.log
2016-01-21 23:12:54.861:INFO:eek:ejs.ServerConnector:main: Started ServerConnector@322267{HTTP/1.1,[http/1.1]}{0.0.0.0:17178}
2016-01-21 23:12:54.861:INFO:eek:ejs.Server:main: Started @1254ms
Emulated network latency: 100ms
jRDC is running (version = 2)
Jan 21, 2016 11:13:29 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
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, dataSourceName -> 1hge15z9erybgisnttiw|a8f0b4, debugUnreturnedConnectionStackTraces -> false, description -> nu...
Class not found: b4a.id.main$_dbcommand, trying: b4j.example.main$_dbcommand
Command: query: select_org, took: 333ms, client=192.168.1.101
Command: query: select_org, took: 7ms, client=192.168.1.101
 
Last edited:
Upvote 0

KingKing

Member
Licensed User
Longtime User
same error happen. the error occur at line 61 Dim res As DBResult = ser.ConvertBytesToObject(data) in HandleJob.

Installing file.
** Activity (main) Pause, UserClosed = false **
PackageAdded: package:b4a.id
Copying updated assets files (13)
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (frmmainmenu) Create, isFirst = true **
** Activity (frmmainmenu) Resume **
** Activity (frmmainmenu) Pause, UserClosed = false **
** Activity (frmsync) Create, isFirst = true **
** Activity (frmsync) Resume **
User click SYNC button.
** Service (httputils2service) Create **
** Service (httputils2service) Start **
Class not found: b4j.example.main$_dbresult, trying: b4a.id.main$_dbresult
Error occurred on line: 61 (DBRequestManager)
Message longer than Log limit (4000). Message was truncated.
java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:295)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:355)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ReadObject(B4XSerializator.java:110)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ConvertBytesToObject(B4XSerializator.java:81)
at b4a.id.dbrequestmanager._handlejob(dbrequestmanager.java:219)
at b4a.id.frmsync._jobdone(frmsync.java:446)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:697)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:336)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5349)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:835)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:77)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readByte(B4XSerializator.java:131)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:299)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:352)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:244)
at anywheresoftware.b4a.r
Message longer than Log limit (4000). Message was truncated.
** Service (starter) Destroy **
** Activity (main) Resume **
 
Upvote 0

KingKing

Member
Licensed User
Longtime User
I did a few more testing by modifying the SQL select statement in config.properties in B4J.
I found out that if the SQL select statement is select from a numeric field, then it will hit the above error. If i cast the numeric field to text, it will NOT hit the error. Conclusion, can not select from numeric field in postgres database.

Now my question is whether JRDC2 support numeric data type in B4J or not?
 
Upvote 0
Top