Android Question java.io.FileNotFoundException

abarnett

Member
Licensed User
Longtime User
I am using B4A V8.50 and the 'new' debug.jar but this problem with java.io.FileNotFoundException: still occurs in debug mode. It not happening every time I run the program, which seems to suggest timing.
 

abarnett

Member
Licensed User
Longtime User
The debug.jar issue is consistent. It is fixed with the updated jar. Any other issue you encounter is not related.

You should post the full error message from the logs.

Error occurred on line: 227 (HttpJob)
java.io.FileNotFoundException: /data/data/b4a.ViatorTrace/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:214)
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:738)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:357)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$2.run(BA.java:365)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:175)
at android.app.ActivityThread.main(ActivityThread.java:5279)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
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)
... 20 more
 
Upvote 0

abarnett

Member
Licensed User
Longtime User
You haven't provided any information.
B4X:
'Returns the response as a string.
Public Sub GetString2(Encoding As String) As String
#if B4i
    Return Response.GetString2(Encoding)
#else
    Dim tr As TextReader
    Dim res As String
    Try
        tr.Initialize2(File.OpenInput(HttpUtils2Service.TempFolder, taskId), Encoding)
        res = tr.ReadAll
        tr.Close
    Catch
        Log(LastException)
    End Try
    Return res
#End If
End Sub
GetString2 is only called in JobDone routine

B4X:
Sub JobDone (Job As HttpJob)
    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
        Select Job.JobName
            Case "Job1", "Job2"
                'print the result to the logs
                'Log(Job.GetString2("Windows-1252"))
                SMReply=Job.GetString2("Windows-1252")
                If SMReply<>Null And SMReply<>"" Then
                    Dim lnSIMCheck As Int=SMReply.IndexOf("Top up")
                    If lnSIMCheck>-1 Then
                        Log(SMReply)
                        SMReply="*"
                    End If
                    If SMReply.SubString2(0,1)<>"*" Then
                        ParseSoapResult(SMReply)
                    End If
                End If
        End Select
    Else
        Log("Error: " & Job.ErrorMessage)
        ProgressDialogHide()
        'ToastMessageShow("SQL Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End Sub
 
Last edited:
Upvote 0
Top