B4J Question App simply exits on httpjob

techknight

Well-Known Member
Licensed User
Longtime User
I am trying to create a simple App Updating method in my B4J App.

Ultimately, it works fine up until I get to the point where it download the exe. The app simply exits with no error on the line that says: Wait For (http2) JobDone(http2 As HttpJob)

I tried moving it into its own sub declared as a resumable sub, and on its own. Soon as it gets to Wait For, the app simply closes.

I dont know why, there is no stacktrace.

Thoughts?

B4X:
Sub CheckForUpdates As ResumableSub
    Dim tempfrm As Form
    Dim http As HttpJob
    Dim VersionInfo As String
    http.Initialize("", Me)
    http.Username = "updater"
    http.Password = "scoreboardapkupdate"
    http.Download(UpdateURL & "version.txt")
    Wait For (http) JobDone(http As HttpJob)
    If http.Success = True Then
        VersionInfo = http.GetString
        http.Release 'Make sure to call this here, or we can end up with a memory leak. Dont want that.
        If Left(VersionInfo, 7) <> "version" Then 'Invalid File Format
            Return True
        End If
        Dim Args() As String = Regex.Split(",", VersionInfo)
        Dim V() As String = Regex.Split("=", Args(0)) 'Get Version Info
        If Val(V(1)) > CurrentAppVersion Then 'There is a newer version
            Dim Active() As String = Regex.Split("=", Args(1)) 'Get Active Update state
            If Active(1) <> "true" Then Return True 'the newer update is not currently active yet
            Dim Forced() As String = Regex.Split("=", Args(2)) 'Check to see if this update is required for operation.
            Dim Changelog() As String = Regex.Split("=", Args(3)) 'Get the changelog information
            Dim ChangelogData() As String = Regex.Split(";", Changelog(1)) 'Get the changelog data block
            Dim I As Int = 0
            Dim Count As Int = 0
            Dim ChangeLogPrompt As String
            For I = 0 To ChangelogData.Length-1 'Go through each item in the change log and display only what is relevant to us.
                Dim Arr() As String = Regex.Split(":", ChangelogData(I))
                If Val(Arr(0)) >= CurrentAppVersion Then 'Display the information if its current to our version and newer. Dont display irrelevent information.
                    If Count = 0 Then 'First entry valid to our version, which is our current version.
                        ChangeLogPrompt = ChangeLogPrompt & Arr(1) & " - Your Version" & Chr(13)
                    Else if I = Changelog.Length Then
                        ChangeLogPrompt = ChangeLogPrompt & Arr(1) & " - Current Version" & Chr(13)
                    Else
                        ChangeLogPrompt = ChangeLogPrompt & Arr(1) & Chr(13)
                    End If
                    ChangeLogPrompt = ChangeLogPrompt & Arr(2) & Chr(13) & Chr(13) 'double space
                    Count = Count + 1
                End If
            Next
            tempfrm.Initialize("tempfrm", 600, 600)
            CenterForm(tempfrm, False)
            If fx.Msgbox2(tempfrm, "There is a software update available for download. Do you wish to update?" & Chr(10) & Chr(13) & "Changelog:" & Chr(13) & ChangeLogPrompt, _
            "Software Update", "Yes", "", "No", fx.MSGBOX_CONFIRMATION) = fx.DialogResponse.POSITIVE Then
                Dim http2 As HttpJob
                http2.Initialize("", Me)
                http2.Username = "updater"
                http2.Password = "scoreboardapkupdate"
                http2.Download(UpdateURL & "installer.exe") '<-- Tried version.txt again to eliminate potential AV or file size issue.
                Wait For (http2) JobDone(http2 As HttpJob) '<-- App drops out here
                If http2.Success = True Then
                    Log("ok")
                    Dim out As OutputStream = File.OpenOutput(File.DirTemp, "installer.exe", False)
                    File.Copy2(http2.GetInputStream, out)
                    out.Close
                    http2.Release
                    Dim sh1 As Shell
                    sh1.Initialize("sh1", File.Combine(File.DirTemp, "installer.exe"), Null)
                    sh1.Run(-1)
                    Return False
                Else
                    http2.Release
                    Log("Failed to download setup file")
                    Return True
                End If
            Else
                If Forced(1) = "true" Then 'Deny program access until the update is complete
                    fx.Msgbox(tempfrm, "You must perform the software update before you can continue to run this software", "Update REQUIRED")
                    Return False
                End If
                Log("Update Cancelled")
                Return True
            End If
        End If
    End If
    http.Release
    Return True
End Sub
 
Last edited:

MarkusR

Well-Known Member
Licensed User
Longtime User
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I already tried downloading version.txt again instead of installer.exe, does the same thing. Simply exits.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
if u can provide it as a test project i can look into and see if my pc behave same.
can u try it without Msgbox2 or a Async Version?
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
No matter what I try, after I use httpjob once, its broken for all of eternity of being used in the rest of the program!

I decided to move the installer.exe download into another subroutine, and I called it instead. It downloaded and ran no problem.

But if I call httpjob to download version.txt first, and call httpjob again, it exits the app.

Somethings bugged in the compiler or okhttp or something.

The only requirement I have is the Wait Fors, everything has to happen in sequence and first before the program can move on.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Nope, its a UI project. I tried running it from the command prompt in verbose mode, there is no silent uncaught crashes. it just "exits" cleanly. I dont get it. Verbose mode should display everything including OutOfMemoryErrors or anything along those lines. Nothing.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
here is a verbose log. I commented enter and exit points

B4X:
[Loaded com.sun.javafx.geom.transform.BaseTransform$Degree from file:/C:/Program
%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.d3d.D3DResourceFactory$$Lambda$133/1456828187 from com.sun
.prism.d3d.D3DResourceFactory]
[Loaded com.sun.prism.shader.FillPgram_Color_Loader from file:/C:/Program%20File
s/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded java.nio.DirectByteBuffer$Deallocator from C:\Program Files\Java\jre1.8.
0_191\lib\rt.jar]
[Loaded com.sun.prism.d3d.D3DShader from file:/C:/Program%20Files/Java/jre1.8.0_
191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.d3d.D3DContext$1 from file:/C:/Program%20Files/Java/jre1.8
.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.effect.impl.prism.PrEffectHelper from file:/C:/Program%
20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.d3d.D3DTexture$1 from file:/C:/Program%20Files/Java/jre1.8
.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.MultiTexture from file:/C:/Program%20Files/Java/jre1.8.0_1
91/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.ps.BaseShaderContext$1 from file:/C:/Program%20Files/
Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.shader.Solid_TextureRGB_Loader from file:/C:/Program%20Fil
es/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.PrinterGraphics from file:/C:/Program%20Files/Java/jre1.8.
0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.GlyphCache from file:/C:/Program%20Files/Java/jre1.8.
0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.packrect.RectanglePacker from file:/C:/Program%20File
s/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.shader.Texture_Color_Loader from file:/C:/Program%20Files/
Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.GlyphCache$GlyphData from file:/C:/Program%20Files/Ja
va/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.IDWriteGlyphRunAnalysis from file:/C:/Pr
ogram%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.IWICImagingFactory from file:/C:/Program
%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.IWICBitmap from file:/C:/Program%20Files
/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.D2D1_RENDER_TARGET_PROPERTIES from file:
/C:/Program%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.D2D1_PIXEL_FORMAT from file:/C:/Program%
20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.ID2D1Factory from file:/C:/Program%20Fil
es/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.ID2D1RenderTarget from file:/C:/Program%
20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.D2D1_POINT_2F from file:/C:/Program%20Fi
les/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.ID2D1Brush from file:/C:/Program%20Files
/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.font.directwrite.IWICBitmapLock from file:/C:/Program%20F
iles/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.shape.MaskData from file:/C:/Program%20Files/Java/jre
1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.packrect.Level from file:/C:/Program%20Files/Java/jre
1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.BufferUtil from file:/C:/Program%20Files/Java/jre1.8.
0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.BufferUtil$$Lambda$134/574599704 from com.sun.prism.i
mpl.BufferUtil]
[Loaded java.nio.DoubleBuffer from C:\Program Files\Java\jre1.8.0_191\lib\rt.jar
]
[Loaded java.nio.ShortBuffer from C:\Program Files\Java\jre1.8.0_191\lib\rt.jar]

[Loaded com.sun.javafx.sg.prism.RegionImageCache from file:/C:/Program%20Files/J
ava/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.BaseResourceFactory$1 from file:/C:/Program%20Files/J
ava/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.sg.prism.RegionImageCache$CachedImage from file:/C:/Progr
am%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.geom.Path2D$CornerPrefix from file:/C:/Program%20Files/Ja
va/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.shape.ShapeUtil from file:/C:/Program%20Files/Java/jr
e1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.shape.ShapeRasterizer from file:/C:/Program%20Files/J
ava/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.shape.NativePiscesRasterizer from file:/C:/Program%20
Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.shape.NativePiscesRasterizer$$Lambda$135/1110421483 f
rom com.sun.prism.impl.shape.NativePiscesRasterizer]
[Loaded com.sun.javafx.image.impl.ByteGray from file:/C:/Program%20Files/Java/jr
e1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.image.impl.ByteGray$Accessor from file:/C:/Program%20File
s/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.image.impl.BaseByteToByteConverter$ByteAnyToSameConverter
 from file:/C:/Program%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.paint.Stop from file:/C:/Program%20Files/Java/jre1.8.0_191
/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.paint.Gradient from file:/C:/Program%20Files/Java/jre1.8.0
_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.paint.LinearGradient from file:/C:/Program%20Files/Java/jr
e1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.geom.Path2D$Iterator from file:/C:/Program%20Files/Java/j
re1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.geom.Path2D$TxIterator from file:/C:/Program%20Files/Java
/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.impl.ps.PaintHelper from file:/C:/Program%20Files/Java/jre
1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.prism.paint.RadialGradient from file:/C:/Program%20Files/Java/jr
e1.8.0_191/lib/ext/jfxrt.jar]
[Loaded java.nio.DirectFloatBufferU from C:\Program Files\Java\jre1.8.0_191\lib\
rt.jar]
[Loaded com.sun.prism.shader.Texture_LinearGradient_PAD_Loader from file:/C:/Pro
gram%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded java.util.ArrayList$ListItr from C:\Program Files\Java\jre1.8.0_191\lib\
rt.jar]
[Loaded java.util.Collections$UnmodifiableList$1 from C:\Program Files\Java\jre1
.8.0_191\lib\rt.jar]
[Loaded com.sun.prism.shader.Mask_TextureSuper_Loader from file:/C:/Program%20Fi
les/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.glass.ui.EventLoop from file:/C:/Program%20Files/Java/jre1.8.0_1
91/lib/ext/jfxrt.jar]
[Loaded com.sun.glass.ui.EventLoop$State from file:/C:/Program%20Files/Java/jre1
.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.tk.quantum.CursorUtils from file:/C:/Program%20Files/Java
/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.tk.quantum.CursorUtils$1 from file:/C:/Program%20Files/Ja
va/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.glass.ui.Size from file:/C:/Program%20Files/Java/jre1.8.0_191/li
b/ext/jfxrt.jar]
[Loaded com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$136/1184986749 f
rom com.sun.javafx.tk.quantum.GlassViewEventHandler]
[Loaded javafx.scene.input.MouseEvent$Flags from file:/C:/Program%20Files/Java/j
re1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.scene.input.PickResult from file:/C:/Program%20Files/Java/jre1.8.
0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.scene.input.InputEventUtils from file:/C:/Program%20Files
/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.scene.input.TransferMode from file:/C:/Program%20Files/Java/jre1.
8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.geom.PickRay from file:/C:/Program%20Files/Java/jre1.8.0_
191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.scene.input.PickResultChooser from file:/C:/Program%20Fil
es/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded java.util.EnumMap$Values from C:\Program Files\Java\jre1.8.0_191\lib\rt.
jar]
[Loaded java.util.EnumMap$EnumMapIterator from C:\Program Files\Java\jre1.8.0_19
1\lib\rt.jar]
[Loaded java.util.EnumMap$ValueIterator from C:\Program Files\Java\jre1.8.0_191\
lib\rt.jar]
[Loaded javafx.scene.Node$$Lambda$137/1507548790 from javafx.scene.Node]
[Loaded com.sun.javafx.sg.prism.NGPerspectiveCamera from file:/C:/Program%20File
s/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.geom.transform.TransformHelper from file:/C:/Program%20Fi
les/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.sg.prism.NGNode$RenderRootResult from file:/C:/Program%20
Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.glass.ui.Clipboard from file:/C:/Program%20Files/Java/jre1.8.0_1
91/lib/ext/jfxrt.jar]
[Loaded com.sun.glass.ui.SystemClipboard from file:/C:/Program%20Files/Java/jre1
.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.glass.ui.win.WinSystemClipboard from file:/C:/Program%20Files/Ja
va/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.glass.ui.win.WinDnDClipboard from file:/C:/Program%20Files/Java/
jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.glass.ui.win.WinClipboardDelegate from file:/C:/Program%20Files/
Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.scene.Scene$DnDGesture from file:/C:/Program%20Files/Java/jre1.8.
0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.javafx.tk.TKDragSourceListener from file:/C:/Program%20Files/Jav
a/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.scene.Scene$DragDetectedState from file:/C:/Program%20Files/Java/
jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.AnimationAccessor from file:/C:/Progra
m%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.AnimationAccessorImpl from file:/C:/Program%20Files/Jav
a/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.Animation$2 from file:/C:/Program%20Files/Java/jre1.8.0
_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.Animation$3 from file:/C:/Program%20Files/Java/jre1.8.0
_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.Animation$AnimationReadOnlyProperty from file:/C:/Progr
am%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.Animation$CurrentRateProperty from file:/C:/Program%20F
iles/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.Animation$CurrentTimeProperty from file:/C:/Program%20F
iles/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.Animation$4 from file:/C:/Program%20Files/Java/jre1.8.0
_191/lib/ext/jfxrt.jar]
[Loaded javafx.util.Duration from file:/C:/Program%20Files/Java/jre1.8.0_191/lib
/ext/jfxrt.jar]
[Loaded javafx.animation.Animation$Status from file:/C:/Program%20Files/Java/jre
1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.Animation$1 from file:/C:/Program%20Files/Java/jre1.8.0
_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.ClipEnvelope from file:/C:/Program%20F
iles/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.SingleLoopClipEnvelope from file:/C:/P
rogram%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.InfiniteClipEnvelope from file:/C:/Pro
gram%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.FiniteClipEnvelope from file:/C:/Progr
am%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.Timeline$1 from file:/C:/Program%20Files/Java/jre1.8.0_
191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.TimelineClipCore from file:/C:/Program
%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.animation.KeyFrame from file:/C:/Program%20Files/Java/jre1.8.0_19
1/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.TimelineClipCore$$Lambda$138/374563487
 from com.sun.scenario.animation.shared.TimelineClipCore]
[Loaded com.sun.scenario.animation.shared.ClipInterpolator from file:/C:/Program
%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.SimpleClipInterpolator from file:/C:/P
rogram%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.GeneralClipInterpolator from file:/C:/
Program%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.shared.InterpolationInterval from file:/C:/Pr
ogram%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded javafx.scene.Scene$ClickCounter$$Lambda$139/284998652 from javafx.scene.
Scene$ClickCounter]
[Loaded javafx.animation.KeyValue from file:/C:/Program%20Files/Java/jre1.8.0_19
1/lib/ext/jfxrt.jar]
[Loaded javafx.animation.Animation$5 from file:/C:/Program%20Files/Java/jre1.8.0
_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.AnimationPulseMBean from file:/C:/Program%20F
iles/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.AnimationPulse from file:/C:/Program%20Files/
Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.AnimationPulse$AnimationPulseHolder from file
:/C:/Program%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData$Accessor from file:/
C:/Program%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData from file:/C:/Progra
m%20Files/Java/jre1.8.0_191/lib/ext/jfxrt.jar] '<--- When its sitting on the prompt window to click yes. I clicked yes,
[Loaded java.lang.invoke.LambdaForm$DMH/1917893191 from java.lang.invoke.LambdaF
orm]
[Loaded java.lang.invoke.LambdaForm$DMH/101676396 from java.lang.invoke.LambdaFo
rm]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData$$Lambda$140/11521609
99 from com.sun.scenario.animation.AnimationPulse$PulseData]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData$$Lambda$141/86150674
3 from com.sun.scenario.animation.AnimationPulse$PulseData]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData$$Lambda$142/13170226
29 from com.sun.scenario.animation.AnimationPulse$PulseData]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData$$Lambda$143/28516581
8 from com.sun.scenario.animation.AnimationPulse$PulseData]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData$$Lambda$144/81087633
4 from com.sun.scenario.animation.AnimationPulse$PulseData]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData$$Lambda$145/13269696
39 from com.sun.scenario.animation.AnimationPulse$PulseData]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData$$Lambda$146/336995 f
rom com.sun.scenario.animation.AnimationPulse$PulseData]
[Loaded com.sun.scenario.animation.AnimationPulse$PulseData$$Lambda$147/17924802
57 from com.sun.scenario.animation.AnimationPulse$PulseData]
[Loaded java.lang.invoke.LambdaForm$DMH/226981675 from java.lang.invoke.LambdaFo
rm]
[Loaded javafx.animation.Animation$1$$Lambda$148/604536004 from javafx.animation
.Animation$1]
[Loaded java.lang.invoke.LambdaForm$DMH/1982665560 from java.lang.invoke.LambdaF
orm]
[Loaded java.lang.invoke.LambdaForm$DMH/1116467736 from java.lang.invoke.LambdaF
orm]
[Loaded java.lang.invoke.LambdaForm$MH/1946417997 from java.lang.invoke.LambdaFo
rm]
[Loaded com.sun.javafx.tk.quantum.WindowStage$$Lambda$149/378046818 from com.sun
.javafx.tk.quantum.WindowStage]
[Loaded com.sun.javafx.tk.quantum.QuantumRenderer$$Lambda$150/1572140545 from co
m.sun.javafx.tk.quantum.QuantumRenderer]
[Loaded com.sun.javafx.tk.quantum.ViewScene$$Lambda$151/279512215 from com.sun.j
avafx.tk.quantum.ViewScene]
[Loaded com.sun.javafx.tk.quantum.WindowStage$$Lambda$152/1110985849 from com.su
n.javafx.tk.quantum.WindowStage]
[Loaded java.util.Optional from C:\Program Files\Java\jre1.8.0_191\lib\rt.jar]
[Loaded anywheresoftware.b4a.keywords.Common$3 from file:/Z:/My%20Projects/Major
%20Display/Scoreboards/ScoreAll%20Engine/VSCB3000/Java/Content%20Management%20Sc
oring/Customer%20Proprietary/Northmont%20HS/Objects/result.jar]
[Loaded anywheresoftware.b4a.StandardBA from file:/Z:/My%20Projects/Major%20Disp
lay/Scoreboards/ScoreAll%20Engine/VSCB3000/Java/Content%20Management%20Scoring/C
ustomer%20Proprietary/Northmont%20HS/Objects/result.jar]
[Loaded md.cms3knorthmont.main$ResumableSub_GetInstaller from file:/Z:/My%20Proj '<-- running sub containing second httpjob.
ects/Major%20Display/Scoreboards/ScoreAll%20Engine/VSCB3000/Java/Content%20Manag
ement%20Scoring/Customer%20Proprietary/Northmont%20HS/Objects/result.jar]
[Loaded com.sun.javafx.application.PlatformImpl$$Lambda$153/1827205282 from com.
sun.javafx.application.PlatformImpl]
[Loaded java.util.concurrent.CopyOnWriteArrayList$COWIterator from C:\Program Fi
les\Java\jre1.8.0_191\lib\rt.jar]
[Loaded com.sun.javafx.application.LauncherImpl$$Lambda$154/93962986 from com.su
n.javafx.application.LauncherImpl]
[Loaded com.sun.javafx.application.PlatformImpl$$Lambda$155/42162553 from com.su
n.javafx.application.PlatformImpl]
[Loaded com.sun.javafx.application.PlatformImpl$$Lambda$156/571608343 from com.s
un.javafx.application.PlatformImpl]
[Loaded com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$157/1774973767 from com
.sun.javafx.tk.quantum.QuantumToolkit]
[Loaded com.sun.javafx.tk.quantum.QuantumRenderer$$Lambda$158/929424699 from com
.sun.javafx.tk.quantum.QuantumRenderer]
[Loaded com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$159/355237987 from com.
sun.javafx.tk.quantum.QuantumToolkit]
[Loaded com.sun.prism.ResourceFactoryListener from file:/C:/Program%20Files/Java
/jre1.8.0_191/lib/ext/jfxrt.jar]
[Loaded java.util.IdentityHashMap$KeySet from C:\Program Files\Java\jre1.8.0_191
\lib\rt.jar]
[Loaded java.util.IdentityHashMap$IdentityHashMapIterator from C:\Program Files\
Java\jre1.8.0_191\lib\rt.jar]
[Loaded java.util.IdentityHashMap$KeyIterator from C:\Program Files\Java\jre1.8.
0_191\lib\rt.jar] '<-- exits at this point. WTF.

Z:\My Projects\Major Display\Scoreboards\ScoreAll Engine\VSCB3000\Java\Content M
anagement Scoring\Customer Proprietary\Northmont HS\Objects>

I am googling until my eyeballs explode, I cannot find a way to trap java exits with a stack dump. Grrrr

Edit: Using jconsole and some other debug options, I checked memory allocation and I am not even getting close to the heap limit. So I know its not a memory issue.
 
Last edited:
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Switched over to Xui MsgboxAsync, and no change.

Even got rid of the Wait For on the 2nd httpjob call, and used a JobDone sub, same thing. just exits.

GRRRRRR Starting to get angry because I dont think its something I can fix.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Here is an example project that I created and added the relevant code, demonstrates the problem.

I have the URL set as a test point, and installer.exe is a test exe that is not executable just FYI.
 

Attachments

  • Live Update Test.zip
    67.9 KB · Views: 280
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Did some more tinkering, its the dialog prompt causing it. If I comment it out, it works fine.

So, why is the dialog prompt whether its modal or Async, causing the 2nd job download NOT to work??
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
i would say u blocked the app start because u used wait for at start.
try this attachment :
 

Attachments

  • Live Update Test MR.zip
    3.7 KB · Views: 217
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Well on my original app, the wait for is in a different sub thats called by the app start. Point being, I don't want the app starting up until the update check is complete.

Edit: Ran it, it does work though, you got further than I did. Again trouble is, I need to figure out how to complete the update check and prompt user yes or no before the rest of the app loads.
 
Last edited:
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I tried this using the CallSubDelayed like you used, but I get the same result. App Exit.

Here is my entry code:

B4X:
Sub AppStart (Form1 As Form, Args() As String)
    Form1.Close
    If Args.Length > 0 Then 
        If Args(0) = "-settings" Then 'We pop up the settings window but NOT run the app
            ReadSettings
            SettingsWindow.Show
        Else
            CallSubDelayed(Me,"ContinueBoot")
        End If
    Else
        CallSubDelayed(Me,"ContinueBoot")
    End If
End Sub

Sub ContinueBoot
    SystemUpdate.UpdateURL = UpdateURL
    SystemUpdate.CurrentAppVersion = CurrentAppVersion
    Wait For (SystemUpdate.CheckForUpdates) Complete (Result As Boolean)
   
    OutputWindow.Initialize("OutputWindow",896,512)
    OutputWindow.SetFormStyle("UNDECORATED")
    OutputWindow.AlwaysOnTop = False
    OutputWindow.RootPane.LoadLayout("Main") 'Load the layout file.
    OutputWindow.WindowTop = 0
   
    ReadSettings
   
    If AppSettings.Get("Screen") = "1" Then 
        OutputWindow.WindowLeft = 0 'Position the output window on the first monitor.
    Else
        OutputWindow.WindowLeft = fx.PrimaryScreen.MaxX 'Position the output window on the second monitor.
    End If
       
    If DakRTD.Initialize(AppSettings.Get("Port"), "00000000", "004210", 622) = False Then 'Failed during open serial port
        SettingsWindow.Show
    End If
   
    CallTimeout = False
   
    Sleep(50)
   
    lblSlotsHome = CollectNodes("1")
    lblSlotsGuest = CollectNodes("2")

    StatPanel.Initialize
    CMSPlayer.Initialize
   
    If UDPSocket1.IsInitialized = False Then UDPSocket1.Initialize("UDP", 1067, 8192) 'Use UDP sockets.
   
    imgLogoGuest.SetImage(fx.LoadImage(File.DirApp, "guestlogo.png"))
    CSSUtils.SetBackgroundImage(OutputWindow.RootPane, File.DirApp, "background.jpg")
   
    ScoreRibbonTimeout.Initialize("ScoreRibbonTimeout", 2000)
   
    pnlScoreboard.SetAlphaAnimated(1, 0)
   
    OutputWindow.Show
End Sub
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
maybe it closed because no form is there. (u used Form1.Close)
can u hide or minimize the main form?
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I dont use form1 at all. I close it because I build a new form called OutputWindow.

form1.visible is a read only function so there is no way to get rid of it but close.

Edit: I can hide the rootpane, maybe thatll work.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Thats what it is. If I comment out MainForm.Show, it screws it up. If I let the mainform show, then it works. What the hell??
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
i think it is related to the event loop.
 
Upvote 0
Top