Good morning,
after doing the client certificate implementation (as described in the B4J Code Snippet section) I ran into a massive issue and i can't figure out what's going on.
The exact code as posted in the Snipped area does work in Windows, the Jar can be started via double click, via shell or via B4J GUI in debug and release mode. This is all good and how it shoud be.....
In MACOS I can start the Jar via CLI. The App dies immediately if I double click the JAR but I can execute via B4J GUI in debug and release mode mode.
In Ubuntu it is even more strange. executing the JAR via shell, double click or Bridge I always will get:
If I remove the BC part from the code the JAR runs on all systems.....
I am sure it is related to Boucycastle but I can't figure it out
who has an idea whats wrong ??
THX a lot
after doing the client certificate implementation (as described in the B4J Code Snippet section) I ran into a massive issue and i can't figure out what's going on.
The exact code as posted in the Snipped area does work in Windows, the Jar can be started via double click, via shell or via B4J GUI in debug and release mode. This is all good and how it shoud be.....
In MACOS I can start the Jar via CLI. The App dies immediately if I double click the JAR but I can execute via B4J GUI in debug and release mode mode.
In Ubuntu it is even more strange. executing the JAR via shell, double click or Bridge I always will get:
B4X:
(InvocationTargetException) java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
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:498)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4j.example.main._appstart(main.java:157)
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:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at b4j.example.main.start(main.java:59)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$106(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$119(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/cert/jcajce/JcaX509CertificateConverter
at b4j.example.main$SslUtil.getSocketFactory(main.java:306)
... 22 more
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.cert.jcajce.JcaX509CertificateConverter
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 23 more
main._appstart (java line: 157)
java.lang.reflect.InvocationTargetException
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:498)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4j.example.main._appstart(main.java:157)
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:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at b4j.example.main.start(main.java:59)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$106(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$119(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/cert/jcajce/JcaX509CertificateConverter
at b4j.example.main$SslUtil.getSocketFactory(main.java:306)
... 22 more
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.cert.jcajce.JcaX509CertificateConverter
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 23 more
If I remove the BC part from the code the JAR runs on all systems.....
B4X:
MqttConnectOptions1.RunMethod("setSocketFactory",Array(jo.RunMethod("getSocketFactory", Array As String (cafile, certfile, keyfile, keyFilePassword))))
I am sure it is related to Boucycastle but I can't figure it out
who has an idea whats wrong ??
THX a lot