Hi All, i've had a project running on my work's google compute engine instance, it's been running fine for a few years, recently I made some small changes but suddenly now it crashes and not sure why, when I run the project on my windows machine, it runs fine without an issue, but when I run it in my compute engine instance it crashes.
Here's the crash log I see
java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:204)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NullPointerException
at com.ab.abmaterial.ABMRadioGroup.RefreshInternal(ABMRadioGroup.java:246)
at com.ab.abmaterial.ABMCell.RefreshInternalExtra(ABMCell.java:1567)
at com.ab.abmaterial.ABMRow.RefreshInternal(ABMRow.java:831)
at com.ab.abmaterial.ABMContainer.RefreshInternalExtra(ABMContainer.java:1915)
at com.ab.abmaterial.ABMModalSheet.RefreshInternalExtra(ABMModalSheet.java:382)
at com.ab.abmaterial.ABMPage.Refresh(ABMPage.java:4063)
at com.ab.template.labinventory._connectpage(labinventory.java:1307)
at com.ab.template.labinventory._websocket_connected(labinventory.java:6791)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
... 7 more
This is the part I added recently, basically I added a radiobutton group to this abmodalsheet that displays a QR code
But for some reason having added that part is causing a crash, can anyone think why this would be, it runs fine on my windows machine that's what's puzzling about this.
By the way I am using ABMaterial library 5.15, I have copied all the necessary files to the compute engine instance as well, here's the code where the abmodalsheet is built along with the radiobutton group.
[CODE lang="b4x" title="Custommodalsheet"]Sub BuildCustomModalSheet() As ABMModalSheet
Dim myModal As ABMModalSheet
myModal.Initialize(page, "printqr", True, ABM.MODALSHEET_TYPE_NORMAL, "modalsheet")
myModal.Content.UseTheme("modalsheet")
myModal.Footer.UseTheme("snapchat")
myModal.Size = ABM.MODALSHEET_SIZE_NORMAL
myModal.MaxHeight = "80%"
myModal.MaxWidth = "35%"
myModal.IsDismissible = False
' create the grid for the content
'''myModal.Content.AddRows(1,True, "").AddCells12(5,"centre")
myModal.Content.AddRowsV(1, True, ABM.VISIBILITY_ALL, "centre").AddCellsOS(1, 4, 4, 4, 6, 6, 6, "centre")
' ALAIN: Add one row with one cell. We will add all our Field containers in this cell
' this way, we do not have to add rows dynamically
myModal.Content.AddRows(1,True, "centre").AddCellsOSMPV(1,3,3,3,6,6,6,0,0,0,0,ABM.VISIBILITY_ALL, "centre")
myModal.Content.AddRows(1,True, "centre").AddCellsOS(1,3,3,3,6,6,6, "centre")
myModal.Content.addrows(1,True,"").AddCellsOSV(1,3,3,3,3,3,3,ABM.VISIBILITY_ALL,"").AddCellsOSV(1,1,1,1,3,3,3,ABM.VISIBILITY_ALL,"")
myModal.Content.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
Log("encrypt: " & encrypt($"Type=${mtype}&Model=${model}&SerialNO=${serialno}"$))
Dim encrypted As String = encrypt($"Type=${mtype}&Model=${model}&SerialNO=${serialno}"$)
'''Dim equiptmentqr As QRCodeGenerator
Dim equiptmentqr As QRCodeGenerator2
Dim murl As String
Dim su As StringUtils
murl = encyptedurl
equiptmentqr.Initialize(page, "equipqr", murl&encrypted, 256)
myModal.Content.Cell(2, 1).AddComponent(equiptmentqr.ABMComp)
Dim option1 As ABMRadioGroup
option1.Initialize(page, "labelsize", "radio")
option1.Title = "Select Label Size"
option1.AddRadioButtonNoLineBreak("50x50 mm", True)
option1.AddRadioButton("50x25 mm", True)
option1.SetActive(1)
myModal.Content.SetBorderex(ABM.COLOR_BLACK, ABM.INTENSITY_DARKEN2, 2, ABM.BORDER_GROOVE, "20px")
myModal.Content.Cell(3,1).AddComponent(option1)
myModal.Content.Cell(3,1).Refresh
' create the buttons for the footer
Dim msbtn1 As ABMButton
msbtn1.InitializeFlat(page, "qrprint", "", "", "PRINT", "footerbutton")
msbtn1.UseFullCellWidth = True
myModal.Content.Cell(4,1).AddComponent(msbtn1)
myModal.Content.Cell(4,1).UseTheme("centre")
Dim msbtn2 As ABMButton
msbtn2.InitializeFlat(page, "qrclose", "", "", "CANCEL", "footerbutton")
msbtn2.UseFullCellWidth = True
myModal.Content.Cell(4,2).AddComponent(msbtn2)
myModal.Content.Cell(4,2).UseTheme("centre")
Return myModal
End Sub[/CODE]
Hope to be able to solve this issue, as I mentioned, i've had this project running for around 3 years and it gets used at work a lot, so it look real bad on me, if I can't get this to work again.
Walter