Hi all,
I want to ask and ask for advice, I'm trying to make a small application to get a list of smartcard readers, after I try to compile (debug and release) it works, the list of smartcard readers appears, but if I build a standalone package form the application only appears briefly then disappears , when I checked there was an error ( java.lang.ClassNotFoundException: javax$smartcardio$TerminalFactory)
My question is, are there still deficiencies in making packages and what should be added, please advise.
thank you
I want to ask and ask for advice, I'm trying to make a small application to get a list of smartcard readers, after I try to compile (debug and release) it works, the list of smartcard readers appears, but if I build a standalone package form the application only appears briefly then disappears , when I checked there was an error ( java.lang.ClassNotFoundException: javax$smartcardio$TerminalFactory)
My question is, are there still deficiencies in making packages and what should be added, please advise.
thank you
b4j script:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
Private TerminalFactory, tf As JavaObject
Private lst As List
Private ComboBox1 As ComboBox
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
tf=TerminalFactory.InitializeStatic("javax.smartcardio.TerminalFactory")
End Sub
public Sub getReaderList As Map
Dim mp As Map
mp.Initialize
tf= TerminalFactory.RunMethod("getInstance",Array("PC/SC",Null))
Try
lst= tf.RunMethodJO("terminals",Null).RunMethod("list",Null)
If lst.Size >0 Then
For i =0 To lst.Size -1
mp.Put(lst.Get(i),i)
Next
mp.Put("count",mp.Size)
mp.Put("errcode",0)
mp.Put("errdesc","success")
End If
Return IIf(mp.Size>0 ,mp,Null)
Catch
mp.Put("count",0)
mp.Put("errcode",-1)
mp.Put("errdesc","no readers avaible")
Log(LastException)
End Try
Return mp
End Sub
Sub Button1_Click
Dim mp As Map = getReaderList
If mp.Size >0 Then
ComboBox1.Items.Add( mp.GetKeyAt(0))
End If
End Sub
Smartcard Error :
main._appstart (java line: -1)
java.lang.ClassNotFoundException: javax$smartcardio$TerminalFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at b4j/anywheresoftware.b4j.object.JavaObject.getCorrectClassName(Unknown Source)
at b4j/anywheresoftware.b4j.object.JavaObject.InitializeStatic(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(Unknown Source)
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)