Android Question [SOLVED] Job.Success = True; Then... why cache enoent error?

Facilauto Juan

Member
Licensed User
Longtime User
Hello there!

I have this code:

B4X:
Sub JobDone(Job As HttpJob)   
      If Job.Success = True Then
        Select Job.JobName
            Case "hjcomprueba_chat"
                descarga_mensajes_chat(Job.GetString)
            Case "hjTime"
                subeMensajes(Job.GetString)
            Case "hjSubida"
                borra_mensaje_local(Job.GetString)
        End Select
    Else       
        'ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End Sub

My problem is that Job.Success is indeed True, so it enters the "if" statement, but wen I get to borra_mensaje_local(Job.GetString), I get this error:

B4X:
java.io.FileNotFoundException: /data/data/testbook.facilauto/cache/6: open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:416)
    at java.io.FileInputStream.<init>(FileInputStream.java:78)
    at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:197)
    at anywheresoftware.b4a.samples.httputils2.httpjob._getstring2(httpjob.java:155)
    at anywheresoftware.b4a.samples.httputils2.httpjob._getstring(httpjob.java:144)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:520)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:235)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:174)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
    at anywheresoftware.b4a.BA$3.run(BA.java:312)

    at android.os.Handler.handleCallback(Handler.java:615)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4949)
    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:1043)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
    at libcore.io.Posix.open(Native Method)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
    at libcore.io.IoBridge.open(IoBridge.java:400)
    ... 22 more
Program compiled in debug mode, can only run with debugger attached.

What could be happening?

Thanks for your answers and your time.
 

Facilauto Juan

Member
Licensed User
Longtime User
Indeed. Its a job that is called inside a "for" loop. Should I be make a "Dim" declaration within the loop? With the same name? Example:

B4X:
If rs.RowCount > 0 Then
            For i = 0 To rs.RowCount - 1
                rs.Position = i
                consulta = "INSERT INTO ..."
                Dim hjSubida as HttpJob
                hjSubida.Initialize("hjSubida", Me)
                consulta_sql_extra(consulta, hjSubida, "", rs.GetString("id"))
            Next
        End If
 
Upvote 0
Top