Android Question Error gone when adding break point.


Active Member
Licensed User
I've got a weird error.
While i was coding there was break points in my code , everything worked so i removed the break points
and then the error came .

Error occurred on line: 0
java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;
at b4j.example.data_layout$ResumableSub_get_isp.resume(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at anywheresoftware.b4a.BA.raiseEvent2(
at anywheresoftware.b4a.ShellBA.raiseEvent2(
at anywheresoftware.b4a.BA.raiseEvent(
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(
at anywheresoftware.b4a.BA.raiseEvent2(
at anywheresoftware.b4a.ShellBA.raiseEvent2(
at anywheresoftware.b4a.keywords.Common.CallSub4(
at anywheresoftware.b4a.keywords.Common.access$0(
at anywheresoftware.b4a.keywords.Common$
at com.sun.javafx.application.PlatformImpl.lambda$null$173(
at Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(
at Method)

When i put a break point back again code is working.
i then add a sleep(5000) to the same place break point was , as i was loading data from jrdc server and thought maybe the
computer to fast ,data lagging. But does not help. i added about 6 more sleeps at diffrent points but nothing helps.

Add the break point and its working.

I made a jar file also, same error..
Please help


Licensed User
Can you show the relevant code? The exception says that you trying to cast a string to an object. Correct this.

The debugger somehow catches some issues by chance via breakpoints. I noticed that before, too.
Upvote 0


Active Member
Licensed User
Hi KMatle

Dim req As DBRequestManager = CreateRequest
 For Each item() As Object In list_isp
     Dim   mastersim As Object = item
   Dim sim_absent_day As String 'hoeveel data wat weg is dag
   Dim sim_absent_night As String ' hoeveel data weg is nag
   Dim sim_booked_day As String ' hoeveel data verkoop is dag
   Dim sim_bookee_night As String ' hoeveel data verkoop is nag
   Dim sim_used_day As String ' hoeveel data verbruik is dag
   Dim sim_used_night As String ' hoeveel data vewrbruik is nag
   Dim sim_total_data_day As String ' kontrak data op hoofsim dag
   Dim sim_total_data_night As String ' kontrak data op hoofsim nag
    sim_booked_day = 0
     sim_bookee_night = 0
   sim_used_day = 0
   sim_used_night = 0
   Dim req As DBRequestManager = CreateRequest
   Dim cmd As DBCommand = CreateCommand("device_search",Array("%%","%%","%%","%%","%"&mastersim&"%"))
   Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
   If j.Success Then
       req.HandleJobAsync(j, "req")
         Wait For (req) req_Result(res As DBResult)
   'work with result
   If res.Rows.Size > 0 Then
       For Each row() As Object In res.Rows
           If (row(res.Columns.Get("cutdate"))) > (DateTime.Date(DateTime.Now)) Then
''''''kry plan data waar op device is
            data_layout_tv_plans.SelectedRow = list_plans.IndexOf(row(res.Columns.Get("plan")))
             Dim plandag As String = (data_layout_tv_plans.SelectedRowValues(1))
            Dim plannag As String = (data_layout_tv_plans.SelectedRowValues(2))

'''''''werk uit hoeveel verkoop data oor is.
sim_booked_day = sim_booked_day + plandag
sim_bookee_night = sim_bookee_night + plannag

''''''werk uit hoeveel data oor is op device           
           Dim dayleft As Long = ((row(res.Columns.Get("cutdataday"))-row(res.Columns.Get("mtotalday")))/1000000)
           Dim nightleft As Long = ((row(res.Columns.Get("cutdatanight"))-row(res.Columns.Get("mtotalnight")))/1000000)

'''''werk used op master sim uit
sim_used_day = sim_used_day + (plandag - dayleft)
sim_used_night = sim_used_night + (plannag-nightleft)

       End If   
'''''werk uit data weg op master sim
sim_total_data_day = list_plan_size_day.Get(list_isp.IndexOf(mastersim))
sim_total_data_night = list_plan_size_day.Get(list_isp.IndexOf(mastersim))
sim_absent_day = sim_total_data_day - list_plan_data_day_left.Get(list_isp.IndexOf(mastersim)) - sim_used_day
sim_absent_night = sim_total_data_night - list_plan_data_night_left.Get(list_isp.IndexOf(mastersim)) - sim_used_night

   '''table view begin wys
   Dim row1() As Object = Array (mastersim,(list_sim_update_last.Get(list_isp.IndexOf(mastersim))),sim_total_data_day,sim_total_data_night,list_plan_data_day_left.Get(list_isp.IndexOf(mastersim)),list_plan_data_night_left.Get(list_isp.IndexOf(mastersim)),sim_absent_day,sim_absent_night,sim_booked_day,sim_bookee_night,sim_used_day,sim_used_night)
   End If   
    End If

Upvote 0