Bug? NonUI app error at job.download

rwblinn

Well-Known Member
Licensed User
Hi,

this simple nonui app crashes at job1.download with error "Toolkit not found". This is a nonui app and also created as such but it seems to look for javafx toolkit. Have I overlooked something?

B4X:
Version=2.5
AppType=StandardJava
IconFile=
NumberOfModules=0
Build1=Default,b4j.example
NumberOfFiles=0
NumberOfLibraries=2
Library1=jcore
Library2=jhttputils2
Sub AppStart (Args() As String)
    Log("Start")
    JobStart
End Sub
Sub JobStart
    Dim job1 As HttpJob
    Log("Job Init...")
    job1.Initialize("Job1", Me)
       Log("Jobname: " & job1.JobName)
    'Send the version file
       Log("Job download start...")
    Dim url As String = "http://www.rwblinn.de/b4j/opensource/todoreader.ver"
       job1.Download(url)
       Log("Job download start completed...")
End Sub
Sub JobDone (Job As HttpJob)
   Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
   If Job.Success = True Then
      Select Job.JobName
         Case "Job1"
            'print the result to the logs
            Log(Job.GetString)
      End Select
   Else
      Log("Error: " & Job.ErrorMessage)
   End If
   Job.Release
End Sub
Errorlog
B4X:
Start
Job Init...
Jobname: Job1
Job download start...
httpjob._download (java line: 93)
java.lang.IllegalStateException: Toolkit not initialized
    at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:270)
    at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:265)
    at javafx.application.Platform.runLater(Platform.java:81)
    at anywheresoftware.b4j.objects.FxBA.postRunnable(FxBA.java:17)
    at anywheresoftware.b4a.keywords.Common.CallSubDelayed4(Common.java:484)
    at anywheresoftware.b4a.keywords.Common.CallSubDelayed2(Common.java:468)
    at b4j.example.httpjob._download(httpjob.java:93)
    at b4j.example.main._jobstart(main.java:87)
    at b4j.example.main._appstart(main.java:43)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at b4j.example.main.main(main.java:28)
 
Top