B4J Question Build standalone UI not showing

yfleury

Active Member
Licensed User
Longtime User
I have a mosquitto mqtt server runing on my computer.
My B4J project is to see what message (text) receive mqtt. Then I show message with clv. Very simple and it work well in debug and release mode too.

I build a standalone but when I run it, the interface pop up and desappear in few milisecondes .

I start run_debug.bat and I have that
B4X:
C:\MQTTlog>cd bin

C:\MQTTlog\bin>java.exe @release_java_modules.txt  -m b4j/b4j.example.main
main$ResumableSub_Mqtt_Connect.resume (java line: -1)
java.lang.IllegalArgumentException: no NetworkModule installed for scheme "tcp" of URI "tcp://xxx.xxx.xxx.xxx:xxxx"
        at b4j/org.eclipse.paho.client.mqttv3.internal.NetworkModuleService.validateURI(Unknown Source)
        at b4j/org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(Unknown Source)
        at b4j/org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(Unknown Source)
        at b4j/org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(Unknown Source)
        at b4j/org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(Unknown Source)
        at b4j/anywheresoftware.b4j.objects.MqttAsyncClientWrapper.Initialize(Unknown Source)
        at b4j/b4j.example.main$ResumableSub_Mqtt_Connect.resume(Unknown Source)
        at b4j/b4j.example.main._mqtt_connect(Unknown Source)
        at b4j/b4j.example.main._appstart(Unknown Source)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
        at b4j/anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
        at b4j/b4j.example.main.start(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)


C:\MQTTlog\bin>pause
Appuyez sur une touche pour continuer...

So I don't understand why it shutdown immediately. I post my project. Don't forget to add your ip for your MQTT server
 

Attachments

  • MQTT.zip
    3.2 KB · Views: 72
Solution
Try adding in main
B4X:
#PackagerProperty: AdditionalModuleInfoString = provides org.eclipse.paho.client.mqttv3.spi.NetworkModuleFactory with org.eclipse.paho.client.mqttv3.internal.TCPNetworkModuleFactory, org.eclipse.paho.client.mqttv3.internal.SSLNetworkModuleFactory,  org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketNetworkModuleFactory, org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketSecureNetworkModuleFactory;

XorAndOr

Active Member
Licensed User
Longtime User
Try adding in main
B4X:
#PackagerProperty: AdditionalModuleInfoString = provides org.eclipse.paho.client.mqttv3.spi.NetworkModuleFactory with org.eclipse.paho.client.mqttv3.internal.TCPNetworkModuleFactory, org.eclipse.paho.client.mqttv3.internal.SSLNetworkModuleFactory,  org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketNetworkModuleFactory, org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketSecureNetworkModuleFactory;
 
Upvote 0
Solution

yfleury

Active Member
Licensed User
Longtime User
Try adding in main
B4X:
#PackagerProperty: AdditionalModuleInfoString = provides org.eclipse.paho.client.mqttv3.spi.NetworkModuleFactory with org.eclipse.paho.client.mqttv3.internal.TCPNetworkModuleFactory, org.eclipse.paho.client.mqttv3.internal.SSLNetworkModuleFactory,  org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketNetworkModuleFactory, org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketSecureNetworkModuleFactory;
I try that, It work great, thanks
 
Upvote 0
Top