iOS Question Httpjob error

Percy Huijer

Member
Licensed User
After updating httpJob version 2.70, Unexpected event (missing RaisesSynchronousEvents): AFTER_SLEEP error occurred.
 

Attachments

  • HttpJob.png
    HttpJob.png
    99.6 KB · Views: 217

Percy Huijer

Member
Licensed User
Sorry 'bout that. See error tekst below.
I face this problem in debug mode only, in relase mode it works fine. The project uses httpJob on the client site and Jrdc2 on the server to connect to a SQLServer database. IDE version 5.30

Application_Start
Application_Active
Unexpected event (missing RaisesSynchronousEvents): AFTER_SLEEP
Error occurred on line: 303 (HttpJob)
Error reading from stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
i-XzPOS -[B4IInputStream ReadBytes:::] + 396
i-XzPOS -[B4IFile Copy2::] + 392
i-XzPOS -[B4IBit InputStreamToBytes:] + 176
i-XzPOS -[ResumableSub_dbrequestmanager_HandleJobAsync resume::] + 612
i-XzPOS -[b4i_dbrequestmanager _handlejobasync:::] + 700
i-XzPOS -[ResumableSub_main_Load_ButtonsTabs resume::] + 2512
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 284
i-XzPOS +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
i-XzPOS -[B4IShell runMethod:] + 448
i-XzPOS -[B4IShell raiseEventImpl:method:args::] + 1640
i-XzPOS __40-[B4IShell raiseEventImpl:method:args::]_block_invoke + 36
libdispatch.dylib <redacted> + 24
libdispatch.dylib <redacted> + 16
libdispatch.dylib <redacted> + 1012
CoreFoundation <redacted> + 12
CoreFoundation <redacted> + 2272
CoreFoundation CFRunLoopRunSpecific + 552
GraphicsServices GSEventRunModal + 100
UIKit UIApplicationMain + 236
i-XzPOS main + 124
libdyld.dylib <redacted> + 4
)
 
Upvote 0

Percy Huijer

Member
Licensed User
B4X:
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Splash.Initialize("Splash")
Splash.RootPanel.LoadLayout("Splash")
NavControl.ShowPage(Splash)
lblVersion.Text = "Versie: "& GetVersion

reqManager.Initialize(Me, rdcLink)
' only for testing, removes the database
'File.Delete(SQLDataBasePath, SQLDateBaseName) 

'check if the database already exists
If File.Exists(SQLDataBasePath, SQLDateBaseName) = False Then
'copy the default DB
File.Copy(File.DirAssets, SQLDateBaseName, SQLDataBasePath, SQLDateBaseName)
'if not, initialize it 
SQL1.Initialize(SQLDataBasePath, SQLDateBaseName, True)
'and create it
'CreateDataBase
Else
'if yes, initialize it
SQL1.Initialize(SQLDataBasePath, SQLDateBaseName, True)
End If

bInit = True
' ReadDataBaseIDs
'Read gKassaId from local DB
gKassaId = 12

'cleanup local database table first
delete_local_table("ToetsenbordTabsPhone")
wait for (Load_ButtonsTabs(1)) complete (Result As Boolean)
If Result Then
Log("Connected data fetched")
Else
Msgbox2("Msg" , "Error connecting to Server: " & rdcLink, "I-XzPOS", Array ("OK"))
Wait For Msg_Click (ButtonText As String)
If ButtonText = "OK" Then
Return
End If

End If

'cleanup local database table first
delete_local_table("ToetsenbordPhone")
wait for (Load_Buttons(1)) complete (Result As Boolean)

'cleanup local database table first
delete_local_table("BTW")
wait for (Load_BTW) complete (Result As Boolean)

'cleanup local database table first
delete_local_table("Artikel")
wait for (Load_Artikel) complete (Result As Boolean)

'cleanup local database table first
delete_local_table("Prijs")
wait for (Load_Prijs) complete (Result As Boolean)

'Attempt to connect and get Current shift
wait for (Get_ServerShiftID) complete (Result As Boolean)

SQLMain.Initialize("SQLMain")
SQLMain.RootPanel.LoadLayout("SQLMain")

StartMenu.Show

End Sub


Sub Load_ButtonsTabs(GroepId As Int) As ResumableSub

Dim req As DBRequestManager = CreateRequest
Dim cmd1 As DBCommand = CreateCommand("select_ToetsenbordTabsPhone", Array(GroepId))
Dim Query As String
Dim rs As ResultSet
Dim Values(4) As String
HUD1.ProgressDialogShow("Laden ToetsenTab tabel")
'prepare sql for insert into local table
Query = "INSERT INTO ToetsenbordTabsPhone VALUES (?,?,?,?)"

'retrieve from server database 
Wait For (req.ExecuteQuery(cmd1, 0, Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j,"req")
wait for (req) req_result(res As DBResult)
Log(res.Columns)
For Each row() As Object In res.Rows
Values(0) = row(0)
Values(1) = row(1)
Values(2) = row(2)
Values(3) = row(3)

SQL1.ExecNonQuery2(Query, Values)
Log(rs)
Next
Else
Log("ERROR: " & j.ErrorMessage)
End If
j.Release

HUD1.ProgressDialogHide
Return j.Success
End Sub
 
Upvote 0
Top