I have the following code that receives HEX data from a GPS device via MQTT.
The code works great:
But when I attempt to write to MySQL, I get the following error:
The code works great:
B4X:
If (messageType = "3089") Then
Dim myLat As String
Dim myLon As String
myLat = raw.SubString2(58,66)
myLon = raw.SubString2(66,74)
Dim b() As Byte=bc.HexToBytes(myLat)
Dim Latitude() As Int=bc.IntsFromBytes(b)
Dim b() As Byte=bc.HexToBytes(myLon)
Dim Longitude() As Int=bc.IntsFromBytes(b)
Log("Latitude: " & Latitude(0))
Log("Longitude: " & Longitude(0))
'sql.write_trans=INSERT INTO trans VALUES (null,?,?,?,?,?,?,Now())
Dim cmd As DBCommand = CreateCommand("write_trans", Array(deviceMAC,Latitude,Longitude, messageType,myfleet,myfriendname))
Dim j As HttpJob = CreateRequest.ExecuteBatch(Array(cmd), Null)
Wait For(j) JobDone(j As HttpJob)
If j.Success Then
Log("write_trans OK")
End If
j.Release
End If
B4X:
Latitude: 282231833
Longitude: -256898516
java.lang.RuntimeException: java.lang.RuntimeException: This method does not support arrays of primitives.
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeType(B4XSerializator.java:285)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeObject(B4XSerializator.java:241)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeList(B4XSerializator.java:269)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeObject(B4XSerializator.java:221)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeMap(B4XSerializator.java:256)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeObject(B4XSerializator.java:224)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.WriteObject(B4XSerializator.java:121)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ConvertObjectToBytes(B4XSerializator.java:79)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator$1.call(B4XSerializator.java:90)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator$1.call(B4XSerializator.java:1)
at anywheresoftware.b4a.BA$4.run(BA.java:292)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.RuntimeException: This method does not support arrays of primitives.
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeObject(B4XSerializator.java:233)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeList(B4XSerializator.java:269)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeObject(B4XSerializator.java:237)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeMap(B4XSerializator.java:256)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeType(B4XSerializator.java:283)
... 15 more
Error building command: (RuntimeException) java.lang.RuntimeException: This method does not support arrays of primitives.