Android Question Enoent Error on httpjob

tufanv

Expert
Licensed User
Longtime User
Hello

I searched the forum and found out that if job.getstring is null i can get an error like this. But i am porting the b4i app to b4a so there is million lines of code that gets job.getstring. Is there an easy way to avoid this error ?

What i get is :

B4X:
Installing file.
PackageAdded: package:com.ct.airline
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
bugun
JobName = bugun, Success = true
Error occurred on line: 168 (HttpJob)
java.io.FileNotFoundException: /data/data/com.ct.airline/cache/1: open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:409)
    at java.io.FileInputStream.<init>(FileInputStream.java:78)
    at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:209)
    at com.ct.airline.httpjob._getstring2(httpjob.java:287)
    at com.ct.airline.httpjob._getstring(httpjob.java:268)
    at com.ct.airline.main._jobdone(main.java:7108)
    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:702)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
    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:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:146)
    at android.app.ActivityThread.main(ActivityThread.java:5602)
    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:1283)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
    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:393)
    ... 23 more
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy **

it points to line on httpjob:
Dim tr As TextReader
tr.Initialize2(File.OpenInput(HttpUtils2Service.TempFolder, taskId), Encoding)

but it does not point to main code so i cant see which line is making the error.
 

tufanv

Expert
Licensed User
Longtime User
Can you post your JobDone code?
I fixed it now. The problem was : because my jobdone is too long i use jobdone2
and both of them have job.release. When i call sub jobdone2 under sub jobdone, that makes 2 job.release that causes the error. You wrote this may cause problem in some other topic while i was searching so i fixed it according to your instructions :) thanks for help.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Make sure to DIM a new httpjob EACH TIME. DONT use global Variable-definitions for HTTPJobs
 
Upvote 0
Top