Bug? Non-UI application with jHttpUtils2 (1.03)

woniol

Active Member
Licensed User
Longtime User
Hi,
I have some problems using jHttpUtils2 library with Non-UI application (console application).
I try it with curl example:
B4X:
'Non-UI application (console application)
#Region  Project Attributes
    #CommandLineArgs: http://www.b4x.com
#End Region

Sub Process_Globals
 
End Sub

Sub AppStart (Args() As String)
    If Args.Length = 0 Then
        Log("URL is missing.")
        ExitApplication2(1)
    End If
    Dim j As HttpJob
    j.Initialize("j", Me)
    j.Download(Args(0))
    StartMessageLoop
End Sub

Sub JobDone(Job As HttpJob)
    If Job.Success Then
        Log(Job.GetString)
    Else
        Log(Job.ErrorMessage)
    End If
    Job.Release
    ExitApplication2(0)
End Sub
It compiles fine , but when I run it I get errors like this:

httpjob._download (java line: 93)
java.lang.NoClassDefFoundError: javafx/application/Platform
at anywheresoftware.b4j.objects.FxBA.postRunnable(FxBA.java:17)
at anywheresoftware.b4a.keywords.Common.CallSubDelayed4(Common.java:465)
at anywheresoftware.b4a.keywords.Common.CallSubDelayed2(Common.java:455)
at b4j.example.httpjob._download(httpjob.java:93)
at b4j.example.main._appstart(main.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.main(main.java:26)
Caused by: java.lang.ClassNotFoundException: javafx.application.Platform
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 12 more
 
Last edited:

woniol

Active Member
Licensed User
Longtime User
Thanks,
I must have missed this statement:

Note that instead of referencing jHttpUtils2, we are using its source code. jHttpUtils2 library depends on jFX (for the GetBitmap method which is removed here).
 
Top