I'm using ZXing library to generate QR code on socket server page, the code runs OK in debug or release mode, but when I generate standalone package I get this error:
any ideas how to fix that?
TIA
any ideas how to fix that?
TIA
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA$3.run(Unknown Source)
at b4j/anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(Unknown Source)
at b4j/anywheresoftware.b4a.StandardBA.startMessageLoop(Unknown Source)
at b4j/anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at b4j/com.google.zxing.qrcode.encoder.Encoder.chooseMode(Unknown Source)
at b4j/com.google.zxing.qrcode.encoder.Encoder.encode(Unknown Source)
at b4j/com.google.zxing.qrcode.QRCodeWriter.encode(Unknown Source)
at b4j/com.puterise.zxing.createQRImage(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.b4j.object.JavaObject.RunMethod(Unknown Source)
at b4j/com.puterise.zxing._qrcode(Unknown Source)
at b4j/etime.server2.qrlogin._vvvvvvvvvvvvvv3(Unknown Source)
at b4j/etime.server2.qrlogin$ResumableSub_Upload_Click.resume(Unknown Source)
at b4j/anywheresoftware.b4a.BA.checkAndRunWaitForEvent(Unknown Source)
... 10 more
Caused by: java.nio.charset.UnsupportedCharsetException: EUC_JP
at java.base/java.nio.charset.Charset.forName(Unknown Source)
at b4j/com.google.zxing.common.StringUtils.<clinit>(Unknown Source)
... 23 more
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA$3.run(Unknown Source)
at b4j/anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(Unknown Source)
at b4j/anywheresoftware.b4a.StandardBA.startMessageLoop(Unknown Source)
at b4j/anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at b4j/com.google.zxing.qrcode.encoder.Encoder.chooseMode(Unknown Source)
at b4j/com.google.zxing.qrcode.encoder.Encoder.encode(Unknown Source)
at b4j/com.google.zxing.qrcode.QRCodeWriter.encode(Unknown Source)
at b4j/com.puterise.zxing.createQRImage(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.b4j.object.JavaObject.RunMethod(Unknown Source)
at b4j/com.puterise.zxing._qrcode(Unknown Source)
at b4j/etime.server2.qrlogin._vvvvvvvvvvvvvv3(Unknown Source)
at b4j/etime.server2.qrlogin$ResumableSub_Upload_Click.resume(Unknown Source)
at b4j/anywheresoftware.b4a.BA.checkAndRunWaitForEvent(Unknown Source)
... 10 more
Caused by: java.nio.charset.UnsupportedCharsetException: EUC_JP
at java.base/java.nio.charset.Charset.forName(Unknown Source)
at b4j/com.google.zxing.common.StringUtils.<clinit>(Unknown Source)
... 23 more
B4X:
private Sub GenerateQR(Val As String,QRname As String)
'Val is the QR string,
'QRname is the qr generated image name, we need that to delete if exists
Dim img As String = File.Combine(Main.AssetFolder, "qrlogin")
Dim generate As ZXing
generate.Initialize
File.Delete(img, $"${QRname}.png"$)
generate.QrCode(Val, 256, File.Combine(img, $"${QRname}.png"$), "png")
'set HTML of image <dev> on page
Dim Html As String = $"<img id="qrimg" src="${QRname}.png" title="qrcode" width="256" height="256"/>
<style > #qrimg {
margin-top: 5px;
border: 1px solid #CCC;
border-radius: 1em;
}
</style>
"$
devqrcodeimg.SetHtml(Html)
ws.Flush
End Sub